// Merge -> revision 8720
This commit is contained in:
@@ -639,7 +639,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
|
||||
$protocol = Tools::usingSecureMode() ? 'https' : 'http';
|
||||
$isoUser = Context::getContext()->language->iso_code;
|
||||
$isoCountry = Context::getContext()->country->iso_code;
|
||||
$stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
|
||||
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 5)));
|
||||
|
||||
// SCREENCAST
|
||||
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3))
|
||||
|
||||
@@ -77,7 +77,11 @@ class AdminAttributes extends AdminTab
|
||||
<input size="33" type="text" name="name_'.$language['id_lang'].'" value="'.htmlspecialchars($this->getFieldValue($obj, 'name', (int)($language['id_lang']))).'" /><sup> *</sup>
|
||||
<span class="hint" name="help_box">'.$this->l('Invalid characters:').' <>;=#{}<span class="hint-pointer"> </span></span>
|
||||
</div>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name');
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
var flag_fields = \'name\';
|
||||
</script>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'flag_fields', 'name', false, true);
|
||||
echo '
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -117,6 +121,7 @@ class AdminAttributes extends AdminTab
|
||||
).'</p>
|
||||
</div>
|
||||
</div>
|
||||
'.Module::hookExec('attributeForm', array('id_attribute' => $obj->id)).'
|
||||
<div class="margin-form">
|
||||
<input type="submit" value="'.$this->l(' Save ').'" name="submitAddattribute" class="button" />
|
||||
</div>
|
||||
@@ -136,6 +141,10 @@ class AdminAttributes extends AdminTab
|
||||
if (!Combination::isFeatureActive())
|
||||
return;
|
||||
|
||||
|
||||
Module::hookExec('postProcessAttribute',
|
||||
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeatureValue to stop saving process
|
||||
|
||||
if (Tools::getValue('submitDel'.$this->table))
|
||||
{
|
||||
if ($this->tabAccess['delete'] === '1')
|
||||
|
||||
@@ -75,6 +75,9 @@ class AdminAttributesGroups extends AdminTab
|
||||
if (Tools::isSubmit('submitAddattribute') || Tools::isSubmit('submitDelattribute'))
|
||||
$this->adminAttributes->postProcess($this->token);
|
||||
|
||||
Module::hookExec('postProcessAttributeGroup',
|
||||
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessAttributeGroup to stop saving process
|
||||
|
||||
if(Tools::getValue('submitDel'.$this->table))
|
||||
{
|
||||
if ($this->tabAccess['delete'] === '1')
|
||||
@@ -226,8 +229,11 @@ class AdminAttributesGroups extends AdminTab
|
||||
<div id="name_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
|
||||
<input size="33" type="text" name="name_'.$language['id_lang'].'" value="'.htmlspecialchars($this->getFieldValue($obj, 'name', (int)($language['id_lang']))).'" /><sup> *</sup>
|
||||
<span class="hint" name="help_box">'.$this->l('Invalid characters:').' <>;=#{}<span class="hint-pointer"> </span></span>
|
||||
</div>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤public_name', 'name');
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var flag_fields = \'name¤public_name\';
|
||||
</script>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'flag_fields', 'name', false, true);
|
||||
echo '
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -240,7 +246,7 @@ class AdminAttributesGroups extends AdminTab
|
||||
<span class="hint" name="help_box">'.$this->l('Invalid characters:').' <>;=#{}<span class="hint-pointer"> </span></span>
|
||||
<p style="clear: both">'.$this->l('Term or phrase displayed to the customer').'</p>
|
||||
</div>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤public_name', 'public_name');
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'flag_fields', 'public_name', false, true);
|
||||
echo '
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
@@ -158,8 +158,11 @@ class AdminFeatures extends AdminTab
|
||||
<div id="name_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
|
||||
<input size="33" type="text" name="name_'.$language['id_lang'].'" value="'.htmlentities($this->getFieldValue($obj, 'name', (int)($language['id_lang'])), ENT_COMPAT, 'UTF-8').'" /><sup> *</sup>
|
||||
<span class="hint" name="help_box">'.$this->l('Invalid characters:').' <>;=#{}<span class="hint-pointer"> </span></span>
|
||||
</div>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name');
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var flag_fields = \'name\';
|
||||
</script>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'flag_fields', 'name', false, true);
|
||||
echo '
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
@@ -193,6 +196,9 @@ class AdminFeatures extends AdminTab
|
||||
$this->adminFeaturesValues->tabAccess = Profile::getProfileAccess($this->context->employee->id_profile, $this->id);
|
||||
$this->adminFeaturesValues->postProcess($this->token);
|
||||
|
||||
Module::hookExec('postProcessFeature',
|
||||
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeature to stop saving process
|
||||
|
||||
if(Tools::getValue('submitDel'.$this->table))
|
||||
{
|
||||
if ($this->tabAccess['delete'] === '1')
|
||||
@@ -214,5 +220,3 @@ class AdminFeatures extends AdminTab
|
||||
parent::postProcess();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -67,8 +67,11 @@ class AdminFeaturesValues extends AdminTab
|
||||
<div id="value_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
|
||||
<input size="33" type="text" name="value_'.$language['id_lang'].'" value="'.htmlentities($this->getFieldValue($obj, 'value', (int)($language['id_lang'])), ENT_COMPAT, 'UTF-8').'" /><sup> *</sup>
|
||||
<span class="hint" name="help_box">'.$this->l('Invalid characters:').' <>;=#{}<span class="hint-pointer"> </span></span>
|
||||
</div>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'value', 'value');
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var flag_fields = \'value\';
|
||||
</script>';
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'flag_fields', 'value', false, true);
|
||||
echo '
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -81,6 +84,7 @@ class AdminFeaturesValues extends AdminTab
|
||||
echo '
|
||||
</select><sup> *</sup>
|
||||
</div>
|
||||
'.Module::hookExec('featureValueForm', array('id_feature_value' => $obj->id)).'
|
||||
<div class="margin-form">
|
||||
<input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" />
|
||||
</div>
|
||||
@@ -94,6 +98,9 @@ class AdminFeaturesValues extends AdminTab
|
||||
*/
|
||||
public function postProcess($token = NULL)
|
||||
{
|
||||
Module::hookExec('postProcessFeatureValue',
|
||||
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeatureValue to stop saving process
|
||||
|
||||
if(Tools::getValue('submitDel'.$this->table))
|
||||
{
|
||||
if ($this->tabAccess['delete'] === '1')
|
||||
|
||||
@@ -250,7 +250,7 @@ class AdminTranslations extends AdminTab
|
||||
$arr_import_lang = explode('|', Tools::getValue('params_import_language')); /* 0 = Language ISO code, 1 = PS version */
|
||||
if (Validate::isLangIsoCode($arr_import_lang[0]))
|
||||
{
|
||||
if ($content = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false, stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
|
||||
if ($content = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false, @stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
|
||||
{
|
||||
$file = _PS_TRANSLATIONS_DIR_.$arr_import_lang[0].'.gzip';
|
||||
if (file_put_contents($file, $content))
|
||||
@@ -712,7 +712,7 @@ class AdminTranslations extends AdminTab
|
||||
$this->displayWarning($this->l('If you choose to update an existing language pack, all your previous customization in the theme named prestashop will be lost. This includes front office expressions and default e-mail templates.'));
|
||||
echo '<div style="font-weight:bold; float:left;">'.$this->l('Language you want to add or update:').' ';
|
||||
|
||||
if ($lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_each_language_pack.php?version='._PS_VERSION_, false, stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
|
||||
if ($lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_each_language_pack.php?version='._PS_VERSION_, false, @stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
|
||||
{
|
||||
// Notice : for php < 5.2 compatibility, Tools::jsonDecode. The second parameter to true will set us
|
||||
if ($lang_packs != '' AND $lang_packs = Tools::jsonDecode($lang_packs,true))
|
||||
|
||||
@@ -2267,22 +2267,26 @@ abstract class AdminTabCore
|
||||
* Display flags in forms for translations
|
||||
*
|
||||
* @param array $languages All languages available
|
||||
* @param integer $defaultLanguage Default language id
|
||||
* @param integer $default_language Default language id
|
||||
* @param string $ids Multilingual div ids in form
|
||||
* @param string $id Current div id]
|
||||
* #param boolean $return define the return way : false for a display, true for a return
|
||||
* @param boolean $return define the return way : false for a display, true for a return
|
||||
* @param boolean $use_vars_instead_of_ids use an js vars instead of ids seperate by "¤"
|
||||
*/
|
||||
public function displayFlags($languages, $defaultLanguage, $ids, $id, $return = false)
|
||||
public function displayFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false)
|
||||
{
|
||||
if (sizeof($languages) == 1)
|
||||
return false;
|
||||
$output = '
|
||||
<div class="displayed_flag">
|
||||
<img src="../img/l/'.$defaultLanguage.'.jpg" class="pointer" id="language_current_'.$id.'" onclick="toggleLanguageFlags(this);" alt="" />
|
||||
<img src="../img/l/'.$default_language.'.jpg" class="pointer" id="language_current_'.$id.'" onclick="toggleLanguageFlags(this);" alt="" />
|
||||
</div>
|
||||
<div id="languages_'.$id.'" class="language_flags">
|
||||
'.$this->l('Choose language:').'<br /><br />';
|
||||
foreach ($languages as $language)
|
||||
if($use_vars_instead_of_ids)
|
||||
$output .= '<img src="../img/l/'.(int)($language['id_lang']).'.jpg" class="pointer" alt="'.$language['name'].'" title="'.$language['name'].'" onclick="changeLanguage(\''.$id.'\', '.$ids.', '.$language['id_lang'].', \''.$language['iso_code'].'\');" /> ';
|
||||
else
|
||||
$output .= '<img src="../img/l/'.(int)($language['id_lang']).'.jpg" class="pointer" alt="'.$language['name'].'" title="'.$language['name'].'" onclick="changeLanguage(\''.$id.'\', \''.$ids.'\', '.$language['id_lang'].', \''.$language['iso_code'].'\');" /> ';
|
||||
$output .= '</div>';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -26,25 +26,25 @@
|
||||
*/
|
||||
|
||||
class AttributeCore extends ObjectModel
|
||||
{
|
||||
{
|
||||
/** @var integer Group id which attribute belongs */
|
||||
public $id_attribute_group;
|
||||
|
||||
|
||||
/** @var string Name */
|
||||
public $name;
|
||||
public $color;
|
||||
public $position;
|
||||
public $default;
|
||||
|
||||
|
||||
protected $fieldsRequired = array('id_attribute_group');
|
||||
protected $fieldsValidate = array('id_attribute_group' => 'isUnsignedId', 'color' => 'isColor', 'position' => 'isInt');
|
||||
protected $fieldsRequiredLang = array('name');
|
||||
protected $fieldsSizeLang = array('name' => 64);
|
||||
protected $fieldsValidateLang = array('name' => 'isGenericName');
|
||||
|
||||
|
||||
protected $table = 'attribute';
|
||||
protected $identifier = 'id_attribute';
|
||||
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'product_option_values',
|
||||
'objectNodeName' => 'product_option_value',
|
||||
@@ -52,14 +52,14 @@ class AttributeCore extends ObjectModel
|
||||
'id_attribute_group' => array('xlink_resource'=> 'product_options'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->image_dir = _PS_COL_IMG_DIR_;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
@@ -70,7 +70,7 @@ class AttributeCore extends ObjectModel
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check then return multilingual fields for database interaction
|
||||
*
|
||||
@@ -96,10 +96,30 @@ class AttributeCore extends ObjectModel
|
||||
if (Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product_attribute` IN ('.implode(', ', $combinationIds).')') === false)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Reinitializing position */
|
||||
$this->cleanPositions((int)$this->id_attribute_group);
|
||||
|
||||
return parent::delete();
|
||||
$return = parent::delete();
|
||||
if ($return)
|
||||
Module::hookExec('afterDeleteAttribute', array('id_attribute' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function update($nullValues = false)
|
||||
{
|
||||
$return = parent::update($nullValues);
|
||||
if ($return)
|
||||
Module::hookExec('afterSaveAttribute', array('id_attribute' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function add($autodate = true, $nullValues = false)
|
||||
{
|
||||
$return = parent::add($autodate, $nullValues);
|
||||
if ($return)
|
||||
Module::hookExec('afterSaveAttribute', array('id_attribute' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +142,7 @@ class AttributeCore extends ObjectModel
|
||||
'.($notNull ? 'WHERE a.`id_attribute` IS NOT NULL AND al.`name` IS NOT NULL' : '').'
|
||||
ORDER BY agl.`name` ASC, a.`position` ASC');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get quantity for a given attribute combinaison
|
||||
* Check if quantity is enough to deserve customer
|
||||
@@ -158,9 +178,9 @@ class AttributeCore extends ObjectModel
|
||||
|
||||
$row = Db::getInstance()->getRow('
|
||||
SELECT SUM(quantity) as quantity
|
||||
FROM `'._DB_PREFIX_.'product_attribute`
|
||||
FROM `'._DB_PREFIX_.'product_attribute`
|
||||
WHERE `id_product` = '.(int)$id_product);
|
||||
|
||||
|
||||
if ($row['quantity'] !== NULL)
|
||||
return (int)$row['quantity'];
|
||||
return false;
|
||||
@@ -179,7 +199,7 @@ class AttributeCore extends ObjectModel
|
||||
|
||||
$id_product = (int)$arr['id_product'];
|
||||
$qty = self::getAttributeQty($id_product);
|
||||
|
||||
|
||||
if ($qty !== false)
|
||||
{
|
||||
$arr['quantity'] = (int)$qty;
|
||||
@@ -215,9 +235,9 @@ class AttributeCore extends ObjectModel
|
||||
{
|
||||
$minimal_quantity = Db::getInstance()->getValue('
|
||||
SELECT `minimal_quantity`
|
||||
FROM `'._DB_PREFIX_.'product_attribute`
|
||||
FROM `'._DB_PREFIX_.'product_attribute`
|
||||
WHERE `id_product_attribute` = '.(int)$id_product_attribute);
|
||||
|
||||
|
||||
if ($minimal_quantity > 1)
|
||||
return (int)$minimal_quantity;
|
||||
return false;
|
||||
@@ -262,7 +282,7 @@ class AttributeCore extends ObjectModel
|
||||
WHERE `id_attribute` = '.(int)$movedAttribute['id_attribute'].'
|
||||
AND `id_attribute_group`='.(int)$movedAttribute['id_attribute_group']));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reorder attribute position in group $id_attribute_group.
|
||||
* Call it after deleting an attribute from a group.
|
||||
@@ -299,9 +319,9 @@ class AttributeCore extends ObjectModel
|
||||
|
||||
/**
|
||||
* getHigherPosition
|
||||
*
|
||||
*
|
||||
* Get the higher attribute position from a group attribute
|
||||
*
|
||||
*
|
||||
* @param integer $id_attribute_group
|
||||
* @return integer $position
|
||||
*/
|
||||
@@ -309,7 +329,7 @@ class AttributeCore extends ObjectModel
|
||||
{
|
||||
$sql = 'SELECT `position`
|
||||
FROM `'._DB_PREFIX_.'attribute`
|
||||
WHERE id_attribute_group = '.(int)$id_attribute_group.'
|
||||
WHERE id_attribute_group = '.(int)$id_attribute_group.'
|
||||
ORDER BY position DESC';
|
||||
return ((DB::getInstance()->getValue($sql)!==false)) ? DB::getInstance()->getValue($sql) : -1;
|
||||
}
|
||||
|
||||
@@ -1206,33 +1206,20 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
|
||||
if ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT)
|
||||
{
|
||||
$shipping = $carrier->getDeliveryPriceByWeight($this->getTotalWeight(), $id_zone);
|
||||
|
||||
if (!isset($tmp))
|
||||
$tmp = $shipping;
|
||||
|
||||
if ($shipping <= $tmp)
|
||||
{
|
||||
$id_carrier = (int)($row['id_carrier']);
|
||||
$tmp = $shipping;
|
||||
}
|
||||
}
|
||||
else // by price
|
||||
{
|
||||
else
|
||||
$shipping = $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)($this->id_currency));
|
||||
|
||||
if (!isset($tmp))
|
||||
$tmp = $shipping;
|
||||
if (!isset($minShippingPrice))
|
||||
$minShippingPrice = $shipping;
|
||||
|
||||
if ($shipping <= $tmp)
|
||||
if ($shipping <= $minShippingPrice)
|
||||
{
|
||||
$id_carrier = (int)($row['id_carrier']);
|
||||
$tmp = $shipping;
|
||||
$minShippingPrice = $shipping;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($id_carrier))
|
||||
$id_carrier = Configuration::get('PS_CARRIER_DEFAULT');
|
||||
@@ -1701,13 +1688,13 @@ class CartCore extends ObjectModel
|
||||
LEFT JOIN '._DB_PREFIX_.'customized_data cd ON cd.id_customization = c.id_customization
|
||||
WHERE c.id_cart = '.(int)$this->id);
|
||||
|
||||
// Group line by id_customization
|
||||
// Get datas from customization table
|
||||
$customsById = array();
|
||||
foreach ($customs AS $custom)
|
||||
{
|
||||
if(!isset($customsById[$custom['id_customization']]))
|
||||
$customsById[$custom['id_customization']] = array();
|
||||
$customsById[$custom['id_customization']][] = $custom;
|
||||
$customsById[$custom['id_customization']] = array('id_product_attribute' => $custom['id_product_attribute'],
|
||||
'id_product' => $custom['id_product'], 'quantity' => $custom['quantity']);
|
||||
}
|
||||
|
||||
// Insert new customizations
|
||||
@@ -1716,8 +1703,8 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'customization` (id_cart, id_product_attribute, id_product, quantity)
|
||||
VALUES('.(int)$cart->id.', '.(int)$custom['id_product_attribute'].', '.(int)$custom['id_product'].', '.(int)$custom['quantity'].')');
|
||||
$custom_ids[$custom['id_customization']] = Db::getInstance(_PS_USE_SQL_SLAVE_)->Insert_ID();
|
||||
VALUES('.(int)$cart->id.', '.(int)$val['id_product_attribute'].', '.(int)$val['id_product'].', '.(int)$val['quantity'].')');
|
||||
$custom_ids[$customizationId] = Db::getInstance(_PS_USE_SQL_SLAVE_)->Insert_ID();
|
||||
}
|
||||
|
||||
// Insert customized_data
|
||||
|
||||
@@ -399,19 +399,27 @@ class CategoryCore extends ObjectModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-calculate the levels of all childs
|
||||
* Updates level_depth for all children of the given id_category
|
||||
*
|
||||
* @param integer $id_category parent category
|
||||
*/
|
||||
public function recalculateLevelDepth($id_category)
|
||||
{
|
||||
/* Gets all childs */
|
||||
$categories = Db::getInstance()->ExecuteS('SELECT id_category, id_parent, level_depth FROM '._DB_PREFIX_.'category
|
||||
WHERE id_parent = '.$id_category);
|
||||
$level = Db::getInstance()->getRow('SELECT level_depth FROM '._DB_PREFIX_.'category
|
||||
WHERE id_category = '.$id_category);
|
||||
/* Update level of depth for all childs */
|
||||
/* Gets all children */
|
||||
$categories = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT id_category, id_parent, level_depth
|
||||
FROM '._DB_PREFIX_.'category
|
||||
WHERE id_parent = '.(int)$id_category);
|
||||
/* Gets level_depth */
|
||||
$level = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT level_depth
|
||||
FROM '._DB_PREFIX_.'category
|
||||
WHERE id_category = '.(int)$id_category);
|
||||
/* Updates level_depth for all children */
|
||||
foreach ($categories as $sub_category)
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'category
|
||||
Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute('
|
||||
UPDATE '._DB_PREFIX_.'category
|
||||
SET level_depth = '.($level['level_depth'] + 1).'
|
||||
WHERE id_category = '.$sub_category['id_category']);
|
||||
/* Recursive call */
|
||||
|
||||
@@ -279,7 +279,7 @@ class CustomerCore extends ObjectModel
|
||||
*
|
||||
* @param string $email e-mail
|
||||
* @param $return_id boolean
|
||||
* @param $ignoreGuest boolean, for exclure guest customer
|
||||
* @param $ignoreGuest boolean, to exclude guest customer
|
||||
* @return Customer ID if found, false otherwise
|
||||
*/
|
||||
static public function customerExists($email, $return_id = false, $ignoreGuest = true, Shop $shop = null)
|
||||
|
||||
@@ -167,10 +167,30 @@ class FeatureValueCore extends ObjectModel
|
||||
return (int)$id_feature_value;
|
||||
}
|
||||
|
||||
public function add($autodate = true, $nullValues = false)
|
||||
{
|
||||
$return = parent::add($autodate, $nullValues);
|
||||
if ($return)
|
||||
Module::hookExec('afterSaveFeatureValue', array('id_feature_value' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
/* Also delete related products */
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'feature_product` WHERE `id_feature_value` = '.(int)$this->id);
|
||||
return parent::delete();
|
||||
$return = parent::delete();
|
||||
|
||||
if ($return)
|
||||
Module::hookExec('afterDeleteFeatureValue', array('id_feature_value' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function update($nullValues = false)
|
||||
{
|
||||
$return = parent::update($nullValues);
|
||||
if ($return)
|
||||
Module::hookExec('afterSaveFeatureValue', array('id_feature_value' => $this->id));
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
@@ -599,6 +599,11 @@ class FrontControllerCore extends ControllerCore
|
||||
asort($nArray);
|
||||
$this->n = abs((int)(Tools::getValue('n', ((isset($this->context->cookie->nb_item_per_page) AND $this->context->cookie->nb_item_per_page >= 10) ? $this->context->cookie->nb_item_per_page : (int)(Configuration::get('PS_PRODUCTS_PER_PAGE'))))));
|
||||
$this->p = abs((int)(Tools::getValue('p', 1)));
|
||||
|
||||
$current_url = tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']);
|
||||
//delete parameter page
|
||||
$current_url = preg_replace('/(\?)?(&)?p=\d+/', '$1', $current_url);
|
||||
|
||||
$range = 2; /* how many pages around page selected */
|
||||
|
||||
if ($this->p < 0)
|
||||
@@ -625,7 +630,8 @@ class FrontControllerCore extends ControllerCore
|
||||
'nArray' => $nArray,
|
||||
'range' => (int)($range),
|
||||
'start' => (int)($start),
|
||||
'stop' => (int)($stop)
|
||||
'stop' => (int)($stop),
|
||||
'current_url' => $current_url
|
||||
);
|
||||
$this->context->smarty->assign($pagination_infos);
|
||||
}
|
||||
|
||||
@@ -56,11 +56,7 @@ class HelpAccessCore
|
||||
$tooltip = '';
|
||||
$url = HelpAccess::URL.'/documentation/renderIcon?label='.$label.'&iso_lang='.$iso_lang.'&country='.$country.'&version='.$version;
|
||||
|
||||
$ctx = stream_context_create(array(
|
||||
'http' => array(
|
||||
'timeout' => 10
|
||||
)
|
||||
));
|
||||
$ctx = @stream_context_create(array('http' => array('timeout' => 10)));
|
||||
|
||||
$res = @file_get_contents($url, 0, $ctx);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ abstract class ModuleCore
|
||||
/** @var string Message display before uninstall a module */
|
||||
public $beforeUninstall = NULL;
|
||||
|
||||
public $_errors = false;
|
||||
protected $_errors = false;
|
||||
|
||||
protected $table = 'module';
|
||||
|
||||
@@ -296,22 +296,26 @@ abstract class ModuleCore
|
||||
* Display flags in forms for translations
|
||||
*
|
||||
* @param array $languages All languages available
|
||||
* @param integer $defaultLanguage Default language id
|
||||
* @param integer $default_language Default language id
|
||||
* @param string $ids Multilingual div ids in form
|
||||
* @param string $id Current div id]
|
||||
* #param boolean $return define the return way : false for a display, true for a return
|
||||
* @param boolean $return define the return way : false for a display, true for a return
|
||||
* @param boolean $use_vars_instead_of_ids use an js vars instead of ids seperate by "¤"
|
||||
*/
|
||||
public function displayFlags($languages, $defaultLanguage, $ids, $id, $return = false)
|
||||
public function displayFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false)
|
||||
{
|
||||
if (sizeof($languages) == 1)
|
||||
return false;
|
||||
$output = '
|
||||
<div class="displayed_flag">
|
||||
<img src="../img/l/'.$defaultLanguage.'.jpg" class="pointer" id="language_current_'.$id.'" onclick="toggleLanguageFlags(this);" alt="" />
|
||||
<img src="../img/l/'.$default_language.'.jpg" class="pointer" id="language_current_'.$id.'" onclick="toggleLanguageFlags(this);" alt="" />
|
||||
</div>
|
||||
<div id="languages_'.$id.'" class="language_flags">
|
||||
'.$this->l('Choose language:').'<br /><br />';
|
||||
foreach ($languages as $language)
|
||||
if($use_vars_instead_of_ids)
|
||||
$output .= '<img src="../img/l/'.(int)($language['id_lang']).'.jpg" class="pointer" alt="'.$language['name'].'" title="'.$language['name'].'" onclick="changeLanguage(\''.$id.'\', '.$ids.', '.$language['id_lang'].', \''.$language['iso_code'].'\');" /> ';
|
||||
else
|
||||
$output .= '<img src="../img/l/'.(int)($language['id_lang']).'.jpg" class="pointer" alt="'.$language['name'].'" title="'.$language['name'].'" onclick="changeLanguage(\''.$id.'\', \''.$ids.'\', '.$language['id_lang'].', \''.$language['iso_code'].'\');" /> ';
|
||||
$output .= '</div>';
|
||||
|
||||
|
||||
@@ -556,7 +556,8 @@ class ToolsCore
|
||||
/**
|
||||
* Display an error according to an error code
|
||||
*
|
||||
* @param integer $code Error code
|
||||
* @param string $string Error message
|
||||
* @param boolean $htmlentities By default at true for parsing error message with htmlentities
|
||||
*/
|
||||
public static function displayError($string = 'Fatal error', $htmlentities = true, Context $context = null)
|
||||
{
|
||||
@@ -656,7 +657,7 @@ class ToolsCore
|
||||
/* Categories specifics meta tags */
|
||||
elseif ($id_category = self::getValue('id_category'))
|
||||
{
|
||||
$page_number = self::getValue('p');
|
||||
$page_number = (int)self::getValue('p');
|
||||
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`, `description`
|
||||
FROM `'._DB_PREFIX_.'category_lang` cl
|
||||
@@ -665,6 +666,8 @@ class ToolsCore
|
||||
{
|
||||
if (empty($row['meta_description']))
|
||||
$row['meta_description'] = strip_tags($row['description']);
|
||||
|
||||
// Paginate title
|
||||
if (!empty($row['meta_title']))
|
||||
$row['meta_title'] = $row['meta_title'].(!empty($page_number) ? ' ('.$page_number.')' : '').' - '.Configuration::get('PS_SHOP_NAME');
|
||||
else
|
||||
@@ -677,7 +680,7 @@ class ToolsCore
|
||||
/* Manufacturers specifics meta tags */
|
||||
elseif ($id_manufacturer = self::getValue('id_manufacturer'))
|
||||
{
|
||||
$page_number = self::getValue('p');
|
||||
$page_number = (int)self::getValue('p');
|
||||
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`
|
||||
FROM `'._DB_PREFIX_.'manufacturer_lang` ml
|
||||
@@ -1178,7 +1181,7 @@ class ToolsCore
|
||||
public static function file_get_contents($url, $useIncludePath = false, $streamContext = NULL, $curlTimeOut = 5)
|
||||
{
|
||||
if ($streamContext == NULL)
|
||||
$streamContext = stream_context_create(array('http' => array('timeout' => 5)));
|
||||
$streamContext = @stream_context_create(array('http' => array('timeout' => 5)));
|
||||
|
||||
if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1')))
|
||||
return @file_get_contents($url, $useIncludePath, $streamContext);
|
||||
|
||||
@@ -25,20 +25,19 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class UpgraderCore{
|
||||
class UpgraderCore
|
||||
{
|
||||
const DEFAULT_CHECK_VERSION_DELAY_HOURS = 24;
|
||||
public $rss_version_link = 'http://www.prestashop.com/xml/version.xml';
|
||||
public $rss_version_link = 'http://www.prestashop.com/xml/upgrader.xml';
|
||||
public $rss_md5file_link_dir = 'http://www.prestashop.com/xml/md5/';
|
||||
/**
|
||||
* link contains hte url where to download the file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $needUpgrade = false;
|
||||
private $noRefresh = false;
|
||||
private $changedFiles = array();
|
||||
private $missingFiles = array();
|
||||
private $versionIsModified = false;
|
||||
private $need_upgrade = false;
|
||||
private $changed_files = array();
|
||||
private $missing_files = array();
|
||||
|
||||
public $version_name;
|
||||
public $version_num;
|
||||
@@ -50,18 +49,9 @@ class UpgraderCore{
|
||||
|
||||
public function __get($var)
|
||||
{
|
||||
if($var == 'needUpgrade')
|
||||
if ($var == 'need_upgrade')
|
||||
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
|
||||
@@ -87,7 +77,7 @@ class UpgraderCore{
|
||||
if (empty($this->link))
|
||||
$this->checkPSVersion();
|
||||
|
||||
return $this->needUpgrade;
|
||||
return $this->need_upgrade;
|
||||
|
||||
}
|
||||
|
||||
@@ -100,13 +90,15 @@ class UpgraderCore{
|
||||
{
|
||||
if (empty($this->link))
|
||||
{
|
||||
|
||||
$lastCheck = Configuration::get('PS_LAST_VERSION_CHECK');
|
||||
if (class_exists('Configuration'))
|
||||
$last_check = Configuration::get('PS_LAST_VERSION_CHECK');
|
||||
else
|
||||
$last_check = 0;
|
||||
// if we use the autoupgrade process, we will never refresh it
|
||||
// except if no check has been done before
|
||||
if ($force OR ($lastCheck < time() - (3600 * Upgrader::DEFAULT_CHECK_VERSION_DELAY_HOURS)) )
|
||||
if ($force || ($last_check < time() - (3600 * Upgrader::DEFAULT_CHECK_VERSION_DELAY_HOURS)))
|
||||
{
|
||||
libxml_set_streams_context(stream_context_create(array('http' => array('timeout' => 3))));
|
||||
libxml_set_streams_context(@stream_context_create(array('http' => array('timeout' => 3))));
|
||||
if ($feed = @simplexml_load_file($this->rss_version_link))
|
||||
{
|
||||
|
||||
@@ -118,7 +110,7 @@ class UpgraderCore{
|
||||
$this->autoupgrade = (int)$feed->autoupgrade;
|
||||
$this->autoupgrade_module = (int)$feed->autoupgrade_module;
|
||||
$this->desc = (string)$feed->desc ;
|
||||
$configLastVersion = array(
|
||||
$config_last_version = array(
|
||||
'name' => $this->version_name,
|
||||
'num' => $this->version_num,
|
||||
'link' => $this->link,
|
||||
@@ -128,22 +120,24 @@ class UpgraderCore{
|
||||
'changelog' => $this->changelog,
|
||||
'desc' => $this->desc
|
||||
);
|
||||
|
||||
Configuration::updateValue('PS_LAST_VERSION',serialize($configLastVersion));
|
||||
if (class_exists('Configuration'))
|
||||
{
|
||||
Configuration::updateValue('PS_LAST_VERSION', serialize($config_last_version));
|
||||
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'];
|
||||
$this->autoupgrade_module = $lastVersionCheck['autoupgrade_module'];
|
||||
$this->md5 = $lastVersionCheck['md5'];
|
||||
$this->desc = $lastVersionCheck['desc'];
|
||||
$this->changelog = $lastVersionCheck['changelog'];
|
||||
$last_version_check = @unserialize(Configuration::get('PS_LAST_VERSION'));
|
||||
$this->version_name = $last_version_check['name'];
|
||||
$this->version_num = $last_version_check['num'];
|
||||
$this->link = $last_version_check['link'];
|
||||
$this->autoupgrade = $last_version_check['autoupgrade'];
|
||||
$this->autoupgrade_module = $last_version_check['autoupgrade_module'];
|
||||
$this->md5 = $last_version_check['md5'];
|
||||
$this->desc = $last_version_check['desc'];
|
||||
$this->changelog = $last_version_check['changelog'];
|
||||
}
|
||||
}
|
||||
// retro-compatibility :
|
||||
@@ -151,7 +145,7 @@ class UpgraderCore{
|
||||
// false otherwise
|
||||
if (version_compare(_PS_VERSION_, $this->version_num, '<'))
|
||||
{
|
||||
$this->needUpgrade = true;
|
||||
$this->need_upgrade = true;
|
||||
return array('name' => $this->version_name, 'link' => $this->link);
|
||||
}
|
||||
else
|
||||
@@ -160,61 +154,69 @@ class UpgraderCore{
|
||||
|
||||
public function getChangedFilesList()
|
||||
{
|
||||
$checksum = simplexml_load_file($this->rss_md5file_link_dir._PS_VERSION_.'.xml');
|
||||
if (count($this->changed_files) == 0)
|
||||
{
|
||||
$checksum = @simplexml_load_file($this->rss_md5file_link_dir._PS_VERSION_.'.xml');
|
||||
if ($checksum === false)
|
||||
throw new Exception('No checksum xml file for your Prestashop version');
|
||||
$this->browseXmlAndCompare($checksum);
|
||||
|
||||
return $this->changedFiles;
|
||||
return false;
|
||||
else
|
||||
$this->browseXmlAndCompare($checksum->ps_root_dir[0]);
|
||||
}
|
||||
return $this->changed_files;
|
||||
}
|
||||
protected function addChangedFile($path)
|
||||
{
|
||||
$this->versionIsModified = true;
|
||||
$this->changedFiles[] = $path;
|
||||
$this->version_is_modified = true;
|
||||
$this->changed_files[] = $path;
|
||||
//array_unique($this->changed_files);
|
||||
}
|
||||
|
||||
protected function addMissingFile($path)
|
||||
{
|
||||
$this->versionIsModified = true;
|
||||
$this->missingFiles[] = $path;
|
||||
$this->version_is_modified = true;
|
||||
$this->missing_files[] = $path;
|
||||
//array_unique($this->missingFile);
|
||||
}
|
||||
|
||||
protected function browseXmlAndCompare($node, &$currentPath = array(), $level = 0)
|
||||
protected function browseXmlAndCompare($node, &$current_path = array(), $level = 1)
|
||||
{
|
||||
foreach ($node as $key => $child)
|
||||
{
|
||||
if (is_object($child) && $child->getName() != 'md5file')
|
||||
if (is_object($child) && $child->getName() == 'dir')
|
||||
{
|
||||
$level += 1;
|
||||
$currentPath[$level] = $child->getName();
|
||||
$this->browseXmlAndCompare($child, $currentPath, $level);
|
||||
$level -= 1;
|
||||
$current_path[$level] = (string)$child['name'];
|
||||
$this->browseXmlAndCompare($child, $current_path, $level + 1);
|
||||
}
|
||||
else
|
||||
else if (is_object($child) && $child->getName() == 'md5file')
|
||||
{
|
||||
$path = '';
|
||||
for ($i=1;$i<=$level;$i++)
|
||||
$path .= $currentPath[$i].'/';
|
||||
$path .= (string)$child->attributes()->name;
|
||||
$path = _PS_ROOT_DIR_.DIRECTORY_SEPARATOR;
|
||||
for ($i = 1; $i < $level; $i++)
|
||||
$path .= $current_path[$i].'/';
|
||||
$path .= (string)$child['name'];
|
||||
$path = str_replace('ps_root_dir',_PS_ROOT_DIR_,$path);
|
||||
|
||||
// replace default admin dir by current one
|
||||
$path = str_replace(_PS_ROOT_DIR_.'/admin', _PS_ADMIN_DIR_, $path);
|
||||
if(!file_exists($path))
|
||||
$this->addMissingFile($path);
|
||||
else if (!$this->compareChecksum($path, (string)$child->attributes()->sum))
|
||||
else if (!$this->compareChecksum($path, (string)$child))
|
||||
$this->addChangedFile($path);
|
||||
// else, file is original (and ok)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function compareChecksum($path, $originalSum)
|
||||
protected function compareChecksum($path, $original_sum)
|
||||
{
|
||||
if (md5_file($path) == $originalSum)
|
||||
if (md5_file($path) == $original_sum)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isAuthenticPrestashopVersion()
|
||||
{
|
||||
return !$this->versionIsModified;
|
||||
$this->getChangedFilesList();
|
||||
return !$this->version_is_modified;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 7095 $
|
||||
* @version Release: $Revision: 8673 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
@@ -34,90 +34,102 @@ class GuestTrackingControllerCore extends FrontController
|
||||
parent::init();
|
||||
|
||||
if ($this->context->customer->isLogged())
|
||||
Tools::redirect('index.php?controller=history');
|
||||
Tools::redirect('history.php');
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
if ($id_order = Tools::getValue('id_order') AND $email = Tools::getValue('email'))
|
||||
parent::process();
|
||||
|
||||
$id_order = (int)Tools::getValue('id_order');
|
||||
$email = Tools::getValue('email');
|
||||
$order = new Order((int)$id_order);
|
||||
|
||||
if (empty($id_order))
|
||||
$this->errors[] = Tools::displayError('Please provide your Order ID');
|
||||
elseif (empty($email))
|
||||
$this->errors[] = Tools::displayError('Please provide your e-mail address');
|
||||
elseif (!Validate::isEmail($email))
|
||||
$this->errors[] = Tools::displayError('Please provide a valid e-mail address');
|
||||
elseif (!Customer::customerExists($email, false, false))
|
||||
$this->errors[] = Tools::displayError('There is no account associated with this e-mail address');
|
||||
elseif (Customer::customerExists($email, false, true))
|
||||
{
|
||||
$order = new Order((int)$id_order);
|
||||
if (!Validate::isLoadedObject($order))
|
||||
$this->errors[] = Tools::displayError('Invalid order');
|
||||
elseif (!$order->isAssociatedAtGuest($email))
|
||||
$this->errors[] = Tools::displayError('Invalid order');
|
||||
else
|
||||
$this->errors[] = Tools::displayError('Your guest account has already been transformed into a customer account. Please log-in to your customer account to view this order, this section is reserved for guest accounts');
|
||||
$this->context->smarty->assign('show_login_link', true);
|
||||
}
|
||||
elseif (!Validate::isLoadedObject($order))
|
||||
$this->errors[] = Tools::displayError('Invalid Order ID');
|
||||
elseif (!$order->isAssociatedAtGuest($email))
|
||||
$this->errors[] = Tools::displayError('123');
|
||||
else
|
||||
{
|
||||
$customer = new Customer((int)$order->id_customer);
|
||||
$id_order_state = (int)($order->getCurrentState());
|
||||
$carrier = new Carrier((int)($order->id_carrier), (int)($order->id_lang));
|
||||
$addressInvoice = new Address((int)($order->id_address_invoice));
|
||||
$addressDelivery = new Address((int)($order->id_address_delivery));
|
||||
$inv_adr_fields = AddressFormat::getOrderedAddressFields($addressInvoice->id_country);
|
||||
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($addressDelivery->id_country);
|
||||
|
||||
$invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressInvoice, $inv_adr_fields);
|
||||
$deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressDelivery, $dlv_adr_fields);
|
||||
|
||||
if ($order->total_discounts > 0)
|
||||
$this->context->smarty->assign('total_old', (float)($order->total_paid - $order->total_discounts));
|
||||
$products = $order->getProducts();
|
||||
$customizedDatas = Product::getAllCustomizedDatas((int)($order->id_cart));
|
||||
Product::addCustomizationPrice($products, $customizedDatas);
|
||||
|
||||
$this->processAddressFormat($addressDelivery, $addressInvoice);
|
||||
$this->context->smarty->assign(array(
|
||||
'shop_name' => Configuration::get('PS_SHOP_NAME'),
|
||||
'order' => $order,
|
||||
'return_allowed' => false,
|
||||
'currency' => new Currency($order->id_currency),
|
||||
'order_state' => (int)($id_order_state),
|
||||
'invoiceAllowed' => (int)(Configuration::get('PS_INVOICE')),
|
||||
'invoice' => (OrderState::invoiceAvailable((int)($id_order_state)) AND $order->invoice_number),
|
||||
'order_history' => $order->getHistory((int)$this->context->language->id, false, true),
|
||||
'products' => $products,
|
||||
'discounts' => $order->getDiscounts(),
|
||||
'carrier' => $carrier,
|
||||
'address_invoice' => $addressInvoice,
|
||||
'invoiceState' => (Validate::isLoadedObject($addressInvoice) AND $addressInvoice->id_state) ? new State((int)($addressInvoice->id_state)) : false,
|
||||
'address_delivery' => $addressDelivery,
|
||||
'deliveryState' => (Validate::isLoadedObject($addressDelivery) AND $addressDelivery->id_state) ? new State((int)($addressDelivery->id_state)) : false,
|
||||
'is_guest' => true,
|
||||
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
||||
'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
|
||||
'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
|
||||
'use_tax' => Configuration::get('PS_TAX'),
|
||||
'customizedDatas' => $customizedDatas,
|
||||
'invoiceAddressFormatedValues' => $invoiceAddressFormatedValues,
|
||||
'deliveryAddressFormatedValues' => $deliveryAddressFormatedValues));
|
||||
if ($carrier->url AND $order->shipping_number)
|
||||
$this->context->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
|
||||
$this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
|
||||
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
|
||||
|
||||
if (Tools::isSubmit('submitTransformGuestToCustomer'))
|
||||
{
|
||||
$customer = new Customer((int)$order->id_customer);
|
||||
$id_order_state = (int)($order->getCurrentState());
|
||||
$carrier = new Carrier((int)($order->id_carrier), (int)($order->id_lang));
|
||||
$addressInvoice = new Address((int)($order->id_address_invoice));
|
||||
$addressDelivery = new Address((int)($order->id_address_delivery));
|
||||
$inv_adr_fields = AddressFormat::getOrderedAddressFields($addressInvoice->id_country);
|
||||
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($addressDelivery->id_country);
|
||||
|
||||
$invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressInvoice, $inv_adr_fields);
|
||||
$deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressDelivery, $dlv_adr_fields);
|
||||
|
||||
if ($order->total_discounts > 0)
|
||||
$this->context->smarty->assign('total_old', (float)($order->total_paid - $order->total_discounts));
|
||||
$products = $order->getProducts();
|
||||
$customizedDatas = Product::getAllCustomizedDatas((int)($order->id_cart));
|
||||
Product::addCustomizationPrice($products, $customizedDatas);
|
||||
|
||||
$this->processAddressFormat($addressDelivery, $addressInvoice);
|
||||
$this->context->smarty->assign(array(
|
||||
'shop_name' => Configuration::get('PS_SHOP_NAME'),
|
||||
'order' => $order,
|
||||
'return_allowed' => false,
|
||||
'currency' => new Currency($order->id_currency),
|
||||
'order_state' => (int)($id_order_state),
|
||||
'invoiceAllowed' => (int)(Configuration::get('PS_INVOICE')),
|
||||
'invoice' => (OrderState::invoiceAvailable((int)($id_order_state)) AND $order->invoice_number),
|
||||
'order_history' => $order->getHistory($this->context->language->id, false, true),
|
||||
'products' => $products,
|
||||
'discounts' => $order->getDiscounts(),
|
||||
'carrier' => $carrier,
|
||||
'address_invoice' => $addressInvoice,
|
||||
'invoiceState' => (Validate::isLoadedObject($addressInvoice) AND $addressInvoice->id_state) ? new State((int)($addressInvoice->id_state)) : false,
|
||||
'address_delivery' => $addressDelivery,
|
||||
'deliveryState' => (Validate::isLoadedObject($addressDelivery) AND $addressDelivery->id_state) ? new State((int)($addressDelivery->id_state)) : false,
|
||||
'is_guest' => true,
|
||||
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
||||
'CUSTOMIZE_FILE' => Product::CUSTOMIZE_FILE,
|
||||
'CUSTOMIZE_TEXTFIELD' => Product::CUSTOMIZE_TEXTFIELD,
|
||||
'use_tax' => Configuration::get('PS_TAX'),
|
||||
'customizedDatas' => $customizedDatas,
|
||||
'invoiceAddressFormatedValues' => $invoiceAddressFormatedValues,
|
||||
'deliveryAddressFormatedValues' => $deliveryAddressFormatedValues));
|
||||
if ($carrier->url AND $order->shipping_number)
|
||||
$this->context->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
|
||||
$this->context->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
|
||||
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
|
||||
|
||||
if (Tools::isSubmit('submitTransformGuestToCustomer'))
|
||||
{
|
||||
$customer = new Customer((int)$order->id_customer);
|
||||
if (!Validate::isLoadedObject($customer))
|
||||
$this->errors[] = Tools::displayError('Invalid customer');
|
||||
if (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password')))
|
||||
$this->errors[] = Tools::displayError('An error occurred while transforming guest to customer.');
|
||||
if (!Tools::getValue('password'))
|
||||
$this->errors[] = Tools::displayError('Invalid password');
|
||||
else
|
||||
$this->context->smarty->assign('transformSuccess', true);
|
||||
}
|
||||
if (!Validate::isLoadedObject($customer))
|
||||
$this->errors[] = Tools::displayError('Invalid customer');
|
||||
if (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password')))
|
||||
$this->errors[] = Tools::displayError('An error occurred while transforming guest to customer.');
|
||||
if (!Tools::getValue('password'))
|
||||
$this->errors[] = Tools::displayError('Invalid password');
|
||||
else
|
||||
$this->context->smarty->assign('transformSuccess', true);
|
||||
}
|
||||
if (sizeof($this->errors))
|
||||
/* Handle brute force attacks */
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'action' => $this->context->link->getPageLink('guest-tracking.php'),
|
||||
'errors' => $this->errors
|
||||
));
|
||||
/* Handle brute force attacks */
|
||||
if (sizeof($this->errors))
|
||||
sleep(1);
|
||||
|
||||
$this->context->smarty->assign(array('action' => $this->context->link->getPageLink('guest-tracking.php'), 'errors' => $this->errors));
|
||||
$this->setTemplate(_PS_THEME_DIR_.'guest-tracking.tpl');
|
||||
}
|
||||
|
||||
|
||||
@@ -778,7 +778,7 @@ if ($lm->getIncludeTradFilename())
|
||||
return '';
|
||||
}
|
||||
|
||||
$stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 3)));
|
||||
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 3)));
|
||||
$content = @file_get_contents('http://www.prestashop.com/partner/preactivation/partners.php?version=1.0', false, $stream_context);
|
||||
if ($content && $content[0] == '<')
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
$p = addslashes(strtolower($_GET['partner']));
|
||||
$c = addslashes(strtolower($_GET['country_iso_code']));
|
||||
|
||||
$stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
|
||||
$stream_context = @stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
|
||||
$content = @file_get_contents('http://www.prestashop.com/partner/preactivation/fields.php?version=1.0&partner='.$p.'&country_iso_code='.$c, false, $stream_context);
|
||||
|
||||
if ($content && $content[0] == '<')
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
if ($_GET['request'] == 'send')
|
||||
{
|
||||
$stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
|
||||
$stream_context = @stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
|
||||
$url = 'http://www.prestashop.com/partner/preactivation/actions.php?version=1.0&partner='.addslashes($_GET['partner']);
|
||||
|
||||
// Protect fields
|
||||
|
||||
@@ -73,9 +73,19 @@ INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`
|
||||
(70, 'featureForm', 'Add fields to the form "feature"', 'Add fields to the form "feature"', 0, 0),
|
||||
(71, 'afterSaveFeature', 'On saving attribute feature', 'On saving attribute feature', 0, 0),
|
||||
(72, 'afterDeleteFeature', 'On deleting attribute feature', 'On deleting attribute feature', 0, 0),
|
||||
(73, 'taxManager', 'Tax Manager Factory', '' , 0, 0),
|
||||
(74, 'afterSaveProduct', 'On saving products', 'On saving products', 0, 0),
|
||||
(75, 'productListAssign', 'Assign product list to a category', 'Assign product list to a category', 0, 0);
|
||||
(73, 'afterSaveProduct', 'On saving products', 'On saving products', 0, 0),
|
||||
(74, 'productListAssign', 'Assign product list to a category', 'Assign product list to a category', 0, 0),
|
||||
(75, 'postProcessAttributeGroup', 'On post-process in admin attribute group', 'On post-process in admin attribute group', 0, 0),
|
||||
(76, 'postProcessFeature', 'On post-process in admin feature', 'On post-process in admin feature', 0, 0),
|
||||
(77, 'featureValueForm', 'Add fileds to the form "feature value"', 'Add fileds to the form "feature value"', 0, 0),
|
||||
(78, 'postProcessFeatureValue', 'On post-process in admin feature value', 'On post-process in admin feature value', 0, 0),
|
||||
(79, 'afterDeleteFeatureValue', 'On deleting attribute feature value', 'On deleting attribute feature value', 0, 0),
|
||||
(90, 'afterSaveFeatureValue', 'On saving attribute feature value', 'On saving attribute feature value', 0, 0),
|
||||
(91, 'attributeForm', 'Add fileds to the form "feature value"', 'Add fileds to the form "feature value"', 0, 0),
|
||||
(92, 'postProcessAttribute', 'On post-process in admin feature value', 'On post-process in admin feature value', 0, 0),
|
||||
(93, 'afterDeleteAttribute', 'On deleting attribute feature value', 'On deleting attribute feature value', 0, 0),
|
||||
(94, 'afterSaveAttribute', 'On saving attribute feature value', 'On saving attribute feature value', 0, 0),
|
||||
(95, 'taxManager', 'Tax Manager Factory', '' , 0, 0);
|
||||
|
||||
INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES
|
||||
(1, 'PS_LANG_DEFAULT', '1', NOW(), NOW()),
|
||||
|
||||
@@ -23,9 +23,18 @@ INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`, `live_edi
|
||||
('attributeGroupForm', 'Add fields to the form "attribute group"', 'Add fields to the form "attribute group"', 0, 0),
|
||||
('afterSaveAttributeGroup', 'On saving attribute group', 'On saving attribute group', 0, 0),
|
||||
('afterDeleteAttributeGroup', 'On deleting attribute group', 'On deleting "attribute group', 0, 0),
|
||||
('featureForm', 'Add fileds to the form "feature"', 'Add fileds to the form "feature"', 0, 0),
|
||||
('featureForm', 'Add fields to the form "feature"', 'Add fields to the form "feature"', 0, 0),
|
||||
('afterSaveFeature', 'On saving attribute feature', 'On saving attribute feature', 0, 0),
|
||||
('afterDeleteFeature', 'On deleting attribute feature', 'On deleting attribute feature', 0, 0),
|
||||
('afterSaveProduct', 'On saving products', 'On saving products', 0, 0),
|
||||
('productListAssign', 'Assign product list to a category', 'Assign product list to a category', 0, 0);
|
||||
|
||||
('productListAssign', 'Assign product list to a category', 'Assign product list to a category', 0, 0),
|
||||
('postProcessAttributeGroup', 'On post-process in admin attribute group', 'On post-process in admin attribute group', 0, 0),
|
||||
('postProcessFeature', 'On post-process in admin feature', 'On post-process in admin feature', 0, 0),
|
||||
('featureValueForm', 'Add fields to the form "feature value"', 'Add fields to the form "feature value"', 0, 0),
|
||||
('postProcessFeatureValue', 'On post-process in admin feature value', 'On post-process in admin feature value', 0, 0),
|
||||
('afterDeleteFeatureValue', 'On deleting attribute feature value', 'On deleting attribute feature value', 0, 0),
|
||||
('afterSaveFeatureValue', 'On saving attribute feature value', 'On saving attribute feature value', 0, 0),
|
||||
('attributeForm', 'Add fields to the form "feature value"', 'Add fields to the form "feature value"', 0, 0),
|
||||
('postProcessAttribute', 'On post-process in admin feature value', 'On post-process in admin feature value', 0, 0),
|
||||
('afterDeleteAttribute', 'On deleting attribute feature value', 'On deleting attribute feature value', 0, 0),
|
||||
('afterSaveAttribute', 'On saving attribute feature value', 'On saving attribute feature value', 0, 0);
|
||||
@@ -209,7 +209,7 @@ if (isFormValid())
|
||||
require_once(dirname(__FILE__).'/../../classes/LocalizationPack.php');
|
||||
|
||||
|
||||
$stream_context = stream_context_create(array('http' => array('timeout' => 5)));
|
||||
$stream_context = @stream_context_create(array('http' => array('timeout' => 5)));
|
||||
$localization_file = @Tools::file_get_contents('http://www.prestashop.com/download/localization_pack.php?country='.$_GET['countryName'], false, $stream_context);
|
||||
if (!$localization_file AND file_exists(dirname(__FILE__).'/../../localization/'.strtolower($_GET['countryName']).'.xml'))
|
||||
$localization_file = @file_get_contents(dirname(__FILE__).'/../../localization/'.strtolower($_GET['countryName']).'.xml');
|
||||
|
||||
@@ -459,15 +459,29 @@ $this->standalone = true;
|
||||
}
|
||||
public function ajaxProcessCheckFilesVersion()
|
||||
{
|
||||
if ($testOrigCore = $this->upgrader->isAuthenticPrestashopVersion() !== false)
|
||||
if ($this->upgrader->isAuthenticPrestashopVersion() !== false)
|
||||
{
|
||||
$this->nextParams['status'] = 'ok';
|
||||
$testOrigCore = true;
|
||||
}
|
||||
else
|
||||
$this->nextParams['status'] = 'nok';
|
||||
{
|
||||
$testOrigCore = false;
|
||||
$this->nextParams['status'] = 'warn';
|
||||
}
|
||||
|
||||
$changedFileList = $this->upgrader->getChangedFilesList();
|
||||
|
||||
if ($changedFileList === false)
|
||||
{
|
||||
$changedFileList = array();
|
||||
$this->nextParams['msg'] = $this->l('Unable to check files');
|
||||
$this->nextParams['status'] = 'error';
|
||||
}
|
||||
else
|
||||
{
|
||||
// echo '<img src="'.$originalCore.'" /> '.
|
||||
$this->nextParams['msg'] = ($testOrigCore?$this->l('Core files are ok'):sprintf($this->l('%s core files have been modified'), sizeof($changedFileList)));
|
||||
}
|
||||
$this->nextParams['result'] = $changedFileList;
|
||||
}
|
||||
public function ajaxProcessUpgradeNow()
|
||||
@@ -534,7 +548,7 @@ $this->standalone = true;
|
||||
if (file_exists($destExtract))
|
||||
Tools::deletedirectory($destExtract);
|
||||
|
||||
if (Tools::ZipExtract($filepath,$destExtract))
|
||||
if (self::ZipExtract($filepath,$destExtract))
|
||||
{
|
||||
$adminDir = str_replace($this->prodRootDir, '', $this->adminDir);
|
||||
rename($this->latestRootDir.DIRECTORY_SEPARATOR.'admin', $this->latestRootDir.DIRECTORY_SEPARATOR.$adminDir);
|
||||
@@ -935,9 +949,11 @@ $this->standalone = true;
|
||||
if (self::ZipExtract($filepath, $destExtract))
|
||||
{
|
||||
// once it's restored, do not delete the archive file. This has to be done manually
|
||||
// but we can empty the var, to avoid loop.
|
||||
$this->backupFilesFilename = '';
|
||||
if (!empty($this->backupDbFilename) AND file_exists($this->backupDbFilename) )
|
||||
{
|
||||
$this->nextDesc = $this->l('Files restored. No database backup found. Restoration done.');
|
||||
$this->nextDesc = $this->l('Files restored. Checking next step ...');
|
||||
$this->next = 'rollback';
|
||||
}
|
||||
else
|
||||
@@ -1548,7 +1564,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
$srcRootWritable = '../img/admin/disabled.gif';
|
||||
echo '<b>'.$this->l('Root directory status').' : </b>'.'<img src="'.$srcRootWritable.'" /> '.($this->rootWritable?$this->l('fully writable'):$this->l('not writable recursively')).'<br/><br/>';
|
||||
|
||||
if ($this->upgrader->needUpgrade)
|
||||
if ($this->upgrader->need_upgrade)
|
||||
{
|
||||
if ($this->upgrader->autoupgrade)
|
||||
$srcAutoupgrade = '../img/admin/enabled.gif';
|
||||
@@ -1556,6 +1572,12 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
$srcAutoupgrade = '../img/admin/disabled.gif';
|
||||
echo '<b>'.$this->l('Autoupgrade allowed').' : </b>'.'<img src="'.$srcAutoupgrade.'" /> '.($this->upgrader->autoupgrade?$this->l('This release allow autoupgrade.'):$this->l('This release does not allow autoupgrade')).'. <br/><br/>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$srcAutoupgrade = '../img/admin/disabled.gif';
|
||||
echo '<b>'.$this->l('Autoupgrade allowed').' : </b>'.'<img src="../img/admin/disabled.gif" /> . <br/><br/>';
|
||||
}
|
||||
|
||||
|
||||
if (Configuration::get('PS_SHOP_ENABLE'))
|
||||
{
|
||||
@@ -1606,7 +1628,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
// echo '<input class="button" type="submit" name="sumbitUpdateVersion" value="'.$this->l('Backup Database, backup files and update right now and in one click !').'"/>';
|
||||
// echo '<input class="button" type="submit" id="refreshCurrent" value="'.$this->l("refresh update dir / current").'"/>';
|
||||
echo '<br/>';
|
||||
if ($this->upgrader->needUpgrade)
|
||||
if ($this->upgrader->need_upgrade)
|
||||
{
|
||||
if($this->configOk())
|
||||
{
|
||||
@@ -2129,8 +2151,12 @@ $js.= '$(document).ready(function(){
|
||||
res = $.parseJSON(res);
|
||||
answer = res.nextParams;
|
||||
$("#checkPrestaShopFilesVersion").html("<span>"+answer.msg+"</span> ");
|
||||
if (answer.status == "error")
|
||||
$("#checkPrestaShopFilesVersion").prepend("<img src=\"../img/admin/warning.gif\" /> ");
|
||||
else
|
||||
{
|
||||
$("#checkPrestaShopFilesVersion").prepend(answer.status);
|
||||
$("#checkPrestaShopFilesVersion").append("<a id=\"toggleChangedList\" class=\"button\" href=\"\">'.$this->l('See or hide the list').'</a><br/>");
|
||||
|
||||
$("#checkPrestaShopFilesVersion").append("<div id=\"changedList\" style=\"display:none \">");
|
||||
|
||||
$("#changedList").html("<ul>");
|
||||
@@ -2139,7 +2165,7 @@ $js.= '$(document).ready(function(){
|
||||
});
|
||||
|
||||
$("#toggleChangedList").bind("click",function(e){e.preventDefault();$("#changedList").toggle();});
|
||||
|
||||
}
|
||||
}
|
||||
,
|
||||
error: function(res,textStatus,jqXHR)
|
||||
|
||||
@@ -25,19 +25,19 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class UpgraderCore{
|
||||
class UpgraderCore
|
||||
{
|
||||
const DEFAULT_CHECK_VERSION_DELAY_HOURS = 24;
|
||||
public $rss_version_link = 'http://www.prestashop.com/xml/version.xml';
|
||||
public $rss_version_link = 'http://www.prestashop.com/xml/upgrader.xml';
|
||||
public $rss_md5file_link_dir = 'http://www.prestashop.com/xml/md5/';
|
||||
/**
|
||||
* link contains hte url where to download the file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $needUpgrade = false;
|
||||
private $noRefresh = false;
|
||||
private $changedFiles = array();
|
||||
private $missingFiles = array();
|
||||
private $need_upgrade = false;
|
||||
private $changed_files = array();
|
||||
private $missing_files = array();
|
||||
|
||||
public $version_name;
|
||||
public $version_num;
|
||||
@@ -49,18 +49,9 @@ class UpgraderCore{
|
||||
|
||||
public function __get($var)
|
||||
{
|
||||
if($var == 'needUpgrade')
|
||||
if ($var == 'need_upgrade')
|
||||
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
|
||||
@@ -86,7 +77,7 @@ class UpgraderCore{
|
||||
if (empty($this->link))
|
||||
$this->checkPSVersion();
|
||||
|
||||
return $this->needUpgrade;
|
||||
return $this->need_upgrade;
|
||||
|
||||
}
|
||||
|
||||
@@ -100,14 +91,14 @@ class UpgraderCore{
|
||||
if (empty($this->link))
|
||||
{
|
||||
if (class_exists('Configuration'))
|
||||
$lastCheck = Configuration::get('PS_LAST_VERSION_CHECK');
|
||||
$last_check = Configuration::get('PS_LAST_VERSION_CHECK');
|
||||
else
|
||||
$lastCheck = 0;
|
||||
$last_check = 0;
|
||||
// if we use the autoupgrade process, we will never refresh it
|
||||
// except if no check has been done before
|
||||
if ($force OR ($lastCheck < time() - (3600 * Upgrader::DEFAULT_CHECK_VERSION_DELAY_HOURS)) )
|
||||
if ($force || ($last_check < time() - (3600 * Upgrader::DEFAULT_CHECK_VERSION_DELAY_HOURS)))
|
||||
{
|
||||
libxml_set_streams_context(stream_context_create(array('http' => array('timeout' => 3))));
|
||||
libxml_set_streams_context(@stream_context_create(array('http' => array('timeout' => 3))));
|
||||
if ($feed = @simplexml_load_file($this->rss_version_link))
|
||||
{
|
||||
|
||||
@@ -119,7 +110,7 @@ class UpgraderCore{
|
||||
$this->autoupgrade = (int)$feed->autoupgrade;
|
||||
$this->autoupgrade_module = (int)$feed->autoupgrade_module;
|
||||
$this->desc = (string)$feed->desc ;
|
||||
$configLastVersion = array(
|
||||
$config_last_version = array(
|
||||
'name' => $this->version_name,
|
||||
'num' => $this->version_num,
|
||||
'link' => $this->link,
|
||||
@@ -131,22 +122,22 @@ class UpgraderCore{
|
||||
);
|
||||
if (class_exists('Configuration'))
|
||||
{
|
||||
Configuration::updateValue('PS_LAST_VERSION',serialize($configLastVersion));
|
||||
Configuration::updateValue('PS_LAST_VERSION', serialize($config_last_version));
|
||||
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'];
|
||||
$this->autoupgrade_module = $lastVersionCheck['autoupgrade_module'];
|
||||
$this->md5 = $lastVersionCheck['md5'];
|
||||
$this->desc = $lastVersionCheck['desc'];
|
||||
$this->changelog = $lastVersionCheck['changelog'];
|
||||
$last_version_check = @unserialize(Configuration::get('PS_LAST_VERSION'));
|
||||
$this->version_name = $last_version_check['name'];
|
||||
$this->version_num = $last_version_check['num'];
|
||||
$this->link = $last_version_check['link'];
|
||||
$this->autoupgrade = $last_version_check['autoupgrade'];
|
||||
$this->autoupgrade_module = $last_version_check['autoupgrade_module'];
|
||||
$this->md5 = $last_version_check['md5'];
|
||||
$this->desc = $last_version_check['desc'];
|
||||
$this->changelog = $last_version_check['changelog'];
|
||||
}
|
||||
}
|
||||
// retro-compatibility :
|
||||
@@ -154,7 +145,7 @@ class UpgraderCore{
|
||||
// false otherwise
|
||||
if (version_compare(_PS_VERSION_, $this->version_num, '<'))
|
||||
{
|
||||
$this->needUpgrade = true;
|
||||
$this->need_upgrade = true;
|
||||
return array('name' => $this->version_name, 'link' => $this->link);
|
||||
}
|
||||
else
|
||||
@@ -163,63 +154,69 @@ class UpgraderCore{
|
||||
|
||||
public function getChangedFilesList()
|
||||
{
|
||||
$checksum = simplexml_load_file($this->rss_md5file_link_dir._PS_VERSION_.'.xml');
|
||||
if (count($this->changed_files) == 0)
|
||||
{
|
||||
$checksum = @simplexml_load_file($this->rss_md5file_link_dir._PS_VERSION_.'.xml');
|
||||
if ($checksum === false)
|
||||
throw new Exception('No checksum xml file for your Prestashop version');
|
||||
$this->browseXmlAndCompare($checksum);
|
||||
|
||||
return $this->changedFiles;
|
||||
return false;
|
||||
else
|
||||
$this->browseXmlAndCompare($checksum->ps_root_dir[0]);
|
||||
}
|
||||
return $this->changed_files;
|
||||
}
|
||||
protected function addChangedFile($path)
|
||||
{
|
||||
$this->versionIsModified = true;
|
||||
$this->changedFiles[] = $path;
|
||||
//array_unique($this->changedFiles);
|
||||
$this->version_is_modified = true;
|
||||
$this->changed_files[] = $path;
|
||||
//array_unique($this->changed_files);
|
||||
}
|
||||
|
||||
protected function addMissingFile($path)
|
||||
{
|
||||
$this->versionIsModified = true;
|
||||
$this->missingFiles[] = $path;
|
||||
$this->version_is_modified = true;
|
||||
$this->missing_files[] = $path;
|
||||
//array_unique($this->missingFile);
|
||||
}
|
||||
|
||||
protected function browseXmlAndCompare($node, &$currentPath = array(), $level = 0)
|
||||
protected function browseXmlAndCompare($node, &$current_path = array(), $level = 1)
|
||||
{
|
||||
foreach ($node as $key => $child)
|
||||
{
|
||||
if (is_object($child) && $child->getName() != 'md5file')
|
||||
if (is_object($child) && $child->getName() == 'dir')
|
||||
{
|
||||
$level += 1;
|
||||
$currentPath[$level] = $child->getName();
|
||||
$this->browseXmlAndCompare($child, $currentPath, $level);
|
||||
$level -= 1;
|
||||
$current_path[$level] = (string)$child['name'];
|
||||
$this->browseXmlAndCompare($child, $current_path, $level + 1);
|
||||
}
|
||||
else
|
||||
else if (is_object($child) && $child->getName() == 'md5file')
|
||||
{
|
||||
$path = '';
|
||||
for ($i=1;$i<=$level;$i++)
|
||||
$path .= $currentPath[$i].'/';
|
||||
$path .= (string)$child->attributes()->name;
|
||||
$path = _PS_ROOT_DIR_.DIRECTORY_SEPARATOR;
|
||||
for ($i = 1; $i < $level; $i++)
|
||||
$path .= $current_path[$i].'/';
|
||||
$path .= (string)$child['name'];
|
||||
$path = str_replace('ps_root_dir',_PS_ROOT_DIR_,$path);
|
||||
|
||||
// replace default admin dir by current one
|
||||
$path = str_replace(_PS_ROOT_DIR_.'/admin', _PS_ADMIN_DIR_, $path);
|
||||
if(!file_exists($path))
|
||||
$this->addMissingFile($path);
|
||||
else if (!$this->compareChecksum($path, (string)$child->attributes()->sum))
|
||||
else if (!$this->compareChecksum($path, (string)$child))
|
||||
$this->addChangedFile($path);
|
||||
// else, file is original (and ok)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function compareChecksum($path, $originalSum)
|
||||
protected function compareChecksum($path, $original_sum)
|
||||
{
|
||||
if (md5_file($path) == $originalSum)
|
||||
if (md5_file($path) == $original_sum)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isAuthenticPrestashopVersion()
|
||||
{
|
||||
return !$this->versionIsModified;
|
||||
$this->getChangedFilesList();
|
||||
return !$this->version_is_modified;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,11 +24,8 @@ $_MODULE['<{autoupgrade}prestashop>adminselfupgrade_4f7c02592a962e40a920f32f3a24
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_3f10faa8b44a7175ae8fc5dcb8dec5de'] = 'Tous les fichiers ont été mis à jour. Mise à jour de la base de données en cours.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_1ad932e3b85eb2907a817cd3e3e6907e'] = 'Erreur pour la mise à jour de %s';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_078a325fbcc1dbd50bd9f969ce954965'] = 'encore %2$s fichiers à mettre à jour.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_62740df131433ec9d45bf1810eefb19b'] = 'erreur pendant la mise à jour de la base de données.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_9a2f2cf276ea9f79b31a815897c0e3e6'] = '%s ignoré.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_63ded4905ba41ac4bf00373df2739576'] = 'création du répertoire %2$s. encore %3$s fichiers à mettre à jour.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_11978affb3b0dbb16c50d571fd05de6d'] = 'erreur lors de la création du répertoire %s';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_1b854285afc1988b6f83414fde5943ab'] = '%1$s copié dans %2$s. encore %3$s fichiers à mettre à jour.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_0e06ce0972ad338e1d96e8589dc21b9c'] = 'erreur lors de la copie de %1$s vers %2$s';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_5f7f50973696d0a42c1efcc07f7820a0'] = 'Votre site est maintenant restauré.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_28517b8a291c50d80aa53a078407065b'] = 'Répertoire racine nettoyée.';
|
||||
@@ -138,9 +135,8 @@ $_MODULE['<{autoupgrade}prestashop>adminselfupgrade_7f786b903ea8045f5b5b7e3c5a4e
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_3a3a651c9a67bca9ac902da789466b93'] = 'Mise à jour instable';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_a22eff458b4f4bce6d3232e367ff0138'] = 'Votre configuration actuelle indique que vous voulez mettre à jour votre système à partir d\'une branche de développement instable, sans numéro de version. Si vous mettez à jour, vous ne pourrez plus appliquer le processus de versions stables officiel.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_dae8ace18bdcbcc6ae5aece263e14fe8'] = 'Options';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_c747916b25dcb02e0e81ee84dbd966ea'] = 'Vous n\'avez pas besoin d\'utiliser cette fonctionnalité.';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_6b3930a184368a458be6e4429f409877'] = 'Mise à jour terminée. Vérifiez votre boutique (essayez de faire une commande, vérifier le thème)';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_91195bbbacc2147a736c849c46368ed8'] = 'Voulez vous restaurer votre boutique';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_6b3930a184368a458be6e4429f409877'] = 'Mise à jour terminée. Vérifiez votre boutique (essayez de faire une commande, vérifier le thème)';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_a498f9476a893d51ee02b3601678d318'] = 'Cliquez pour restaurer la base de donnée';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_f34d5debb2bba76aa3e077937a07e373'] = 'Cliquez pour restaurer les fichiers';
|
||||
$_MODULE['<{autoupgrade}prestashop>adminselfupgrade_60283aa37e2063b2ada2f99216e1332a'] = 'Votre serveur ne peut pas télécharger le fichier. S\'il vous plaît le télécharger d\'abord par ftp dans votre répertoire admin/autoupgrade';
|
||||
|
||||
11
modules/blocklayered/blocklayered-attribute-indexer.php
Normal file
11
modules/blocklayered/blocklayered-attribute-indexer.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
include(dirname(__FILE__).'/../../init.php');
|
||||
include(dirname(__FILE__).'/blocklayered.php');
|
||||
|
||||
if (substr(Tools::encrypt('blocklayered/index'),0,10) != Tools::getValue('token') || !Module::isInstalled('blocklayered'))
|
||||
die('Bad token');
|
||||
|
||||
$blockLayered = new BlockLayered();
|
||||
echo $blockLayered->indexAttribute();
|
||||
@@ -51,7 +51,7 @@ $(document).ready(function()
|
||||
});
|
||||
|
||||
// Click on label
|
||||
$("label a").live({
|
||||
$('label a').live({
|
||||
click: function() {
|
||||
if($(this).parent().parent().find('input').attr('disabled') == '')
|
||||
{
|
||||
@@ -104,19 +104,19 @@ function updatelink(link)
|
||||
|
||||
function getValueSelected(){
|
||||
|
||||
var checkboxChecked = "";
|
||||
$("#layered_form input:checkbox:checked").each(function(){
|
||||
checkboxChecked += '#' + $(this).attr('id')+"="+$(this).val();
|
||||
var checkboxChecked = '';
|
||||
$('#layered_form input:checkbox:checked').each(function(){
|
||||
checkboxChecked += '#' + $(this).attr('id')+'='+$(this).val();
|
||||
});
|
||||
$("#layered_form input:hidden").each(function(){
|
||||
checkboxChecked += '#' + $(this).attr('name')+"="+$(this).val();
|
||||
$('#layered_form input:hidden').each(function(){
|
||||
checkboxChecked += '#' + $(this).attr('name')+'='+$(this).val();
|
||||
});
|
||||
$(['price','weight']).each(function(i, filter) {
|
||||
if ($("#layered_"+filter+"_slider").length)
|
||||
if ($('#layered_'+filter+'_slider').length)
|
||||
{
|
||||
if (typeof($("#layered_"+filter+"_slider").slider('values', 0)) != 'object')
|
||||
if (typeof($('#layered_'+filter+'_slider').slider('values', 0)) != 'object')
|
||||
{
|
||||
checkboxChecked += '#'+filter+'='+$("#layered_"+filter+"_slider").slider('values', 0)+'_'+$("#layered_"+filter+"_slider").slider('values', 1);
|
||||
checkboxChecked += '#'+filter+'='+$('#layered_'+filter+'_slider').slider('values', 0)+'_'+$('#layered_'+filter+'_slider').slider('values', 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -125,7 +125,8 @@ function getValueSelected(){
|
||||
|
||||
function friendlyUrl(link, encode)
|
||||
{
|
||||
var friendlyTab = {
|
||||
var friendlyTab =
|
||||
{
|
||||
'layered_condition_' : 'cond_',
|
||||
'layered_id_attribute_group_' : 'g_',
|
||||
'id_category_layered=' : 'c=',
|
||||
@@ -134,13 +135,17 @@ function friendlyUrl(link, encode)
|
||||
'layered_category_' : 'cat_',
|
||||
};
|
||||
|
||||
if(encode == 'short'){
|
||||
$.each(friendlyTab, function(key, value) {
|
||||
if(encode == 'short')
|
||||
{
|
||||
$.each(friendlyTab, function(key, value)
|
||||
{
|
||||
Expression = new RegExp(key,'g');
|
||||
link = link.replace(Expression, value);
|
||||
});
|
||||
}else{
|
||||
$.each(friendlyTab, function(key, value) {
|
||||
}else
|
||||
{
|
||||
$.each(friendlyTab, function(key, value)
|
||||
{
|
||||
Expression = new RegExp(value,'g');
|
||||
link = link.replace(Expression, key);
|
||||
});
|
||||
@@ -176,9 +181,9 @@ function cancelFilter()
|
||||
{
|
||||
if($(this).attr('rel').search(/_slider$/) > 0)
|
||||
{
|
||||
$('#'+$(this).attr('rel')).slider("values" , 0, $('#'+$(this).attr('rel')).slider( "option" , 'min' ));
|
||||
$('#'+$(this).attr('rel')).slider("values" , 1, $('#'+$(this).attr('rel')).slider( "option" , 'max' ));
|
||||
$('#'+$(this).attr('rel')).slider('option', 'slide')(0,{values:[$('#'+$(this).attr('rel')).slider( "option" , 'min' ), $('#'+$(this).attr('rel')).slider( "option" , 'max' )]});
|
||||
$('#'+$(this).attr('rel')).slider('values' , 0, $('#'+$(this).attr('rel')).slider('option' , 'min' ));
|
||||
$('#'+$(this).attr('rel')).slider('values' , 1, $('#'+$(this).attr('rel')).slider('option' , 'max' ));
|
||||
$('#'+$(this).attr('rel')).slider('option', 'slide')(0,{values:[$('#'+$(this).attr('rel')).slider( 'option' , 'min' ), $('#'+$(this).attr('rel')).slider( 'option' , 'max' )]});
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -242,9 +247,8 @@ function reloadContent(params_plus)
|
||||
// Get nb items per page
|
||||
var n = '';
|
||||
$('#pagination #nb_item').children().each(function(it, option) {
|
||||
if(option.selected) {
|
||||
if (option.selected)
|
||||
n = '&n='+option.value;
|
||||
}
|
||||
});
|
||||
|
||||
ajaxQuery = $.ajax(
|
||||
@@ -267,14 +271,13 @@ function reloadContent(params_plus)
|
||||
ajaxLoaderOn = 0;
|
||||
|
||||
// On submiting nb items form, relaod with the good nb of items
|
||||
$("#pagination form").submit(function() {
|
||||
$('#pagination form').submit(function() {
|
||||
val = $('#pagination #nb_item').val();
|
||||
$('#pagination #nb_item').children().each(function(it, option) {
|
||||
if(option.value == val) {
|
||||
if (option.value == val)
|
||||
$(option).attr('selected', 'selected');
|
||||
} else {
|
||||
else
|
||||
$(option).removeAttr('selected');
|
||||
}
|
||||
});
|
||||
// Reload products and pagination
|
||||
reloadContent();
|
||||
@@ -282,12 +285,28 @@ function reloadContent(params_plus)
|
||||
});
|
||||
ajaxCart.overrideButtonsInThePage();
|
||||
|
||||
if(typeof(reloadProductComparison) == 'function') {
|
||||
if (typeof(reloadProductComparison) == 'function')
|
||||
reloadProductComparison();
|
||||
}
|
||||
initSliders();
|
||||
|
||||
if(typeof(current_friendly_url != 'undefined'))
|
||||
// Currente page url
|
||||
if (typeof(current_friendly_url) == 'undefined')
|
||||
current_friendly_url = '#';
|
||||
|
||||
// Get all sliders value
|
||||
$(['price', 'weight']).each(function(it, sliderType)
|
||||
{
|
||||
if ($('#layered_'+sliderType+'_slider'))
|
||||
{
|
||||
// Check if slider is enable & if slider is used
|
||||
if(typeof($('#layered_'+sliderType+'_slider').slider('values', 0)) != 'object')
|
||||
if ($('#layered_'+sliderType+'_slider').slider('values', 0) != $('#layered_'+sliderType+'_slider').slider('option' , 'min')
|
||||
|| $('#layered_'+sliderType+'_slider').slider('values', 1) != $('#layered_'+sliderType+'_slider').slider('option' , 'max'))
|
||||
current_friendly_url += '/'+sliderType+'-'+$('#layered_'+sliderType+'_slider').slider('values', 0)+'-'+$('#layered_'+sliderType+'_slider').slider('values', 1)
|
||||
}
|
||||
});
|
||||
if (current_friendly_url == '#')
|
||||
current_friendly_url = '#/';
|
||||
window.location = current_friendly_url;
|
||||
}
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,7 @@ current_friendly_url = '#{$current_friendly_url}';
|
||||
<div>
|
||||
{/if}
|
||||
<span class="layered_subtitle">{$filter.name|escape:html:'UTF-8'}</span>
|
||||
<span class="layered_close"><a href="#" rel="layered_{$filter.type}_{$filter.id_key}">v</a></span>
|
||||
<span class="layered_close"><a href="#" rel="ul_layered_{$filter.type}_{$filter.id_key}">v</a></span>
|
||||
<div class="clear"></div>
|
||||
<ul id="ul_layered_{$filter.type}_{$filter.id_key}">
|
||||
{if !isset($filter.slider)}
|
||||
|
||||
@@ -4,6 +4,17 @@ global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_84241e458cdd5162745500a59a3680f3'] = 'Bloc navigation à facettes';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_2d08fa8e157fe3f1875402cbd98aee1b'] = 'Affiche un bloc avec les filtres de la navigation à facettes';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_af1b98adf7f686b84cd0b443e022b7a0'] = 'Catégories';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_abe854305a8ab993455a8a315d268449'] = 'Url :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_6252c0f2c2ed83b7b06dfca86d4650bb'] = 'Les caractères invalides :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_cfe58d0a56f5dee6826496e019d10095'] = 'Format spécifique pour la génération des url pour la navigation à facettes';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_7b250cb374c12c42a75227ba75df7779'] = 'Titre Meta :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_a4020753b3e63fd8a1d0c0b2b33fc999'] = 'Format spécifique pour le titre méta';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_b3786b970611c1a3809dd51b630812a7'] = '\'%s\' n\'est pas une URL valide';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_c3ef60194d18cf4026d22051b3a19428'] = 'Indexable :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_7c831eb524882fd27ecdab45019d1466'] = 'Utilise cet attribut dans l\'url généré par le module de bloc de navigation à facette';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_ccc12c5568381293a27db0232877937b'] = 'Nom du modèle de filtre nécessaire (ne peut être vide)';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_af1b98adf7f686b84cd0b443e022b7a0'] = 'Catégories';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_817c37b9c1f5cd4a450dad384e63e6c7'] = 'Votre filtre';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_3185cefd67b575e582063148e4f15860'] = 'a été mis à jour avec succès.';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_7ccab4d8de5d6b9bb61e99c7bba343ab'] = 'a été ajouté avec succès.';
|
||||
@@ -11,11 +22,26 @@ $_MODULE['<{blocklayered}prestashop>blocklayered_fe016d3b990c2a9dd72ab6b45892f2a
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_4ad0f0fe31d93e0d8dd7a7fc69a72784'] = 'Modèle de filtres supprimé, catégories mises à jour (Modèle par défaut appliqué).';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_91e77d047f2496b7ba8c9def96d03324'] = 'Modèle de filtres non trouvé';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_09da2b6f1217055bb22caa6ea08d9b80'] = 'Navigation à facettes';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_df2bbc994d10995dcffdf96dbb7acbb1'] = 'Index et les caches';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_7c47bdf0ef7a058e0243fd870019f10b'] = 'Une indexation est en cours. Merci de ne pas fermer cette page';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_5e2420d2318025812dc3e231ddb66b0b'] = 'Indexer les prix manquants';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_c590f1d6840cd971922610e7d42cbd9c'] = 'Ré-indexer l\'intégralité des prix';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_d47f700b6db025d98cae0b340ed847e9'] = 'Indexer les attributs';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_ffb323adcfff34b04a48aeaf42f6cbde'] = 'Indexer les URLs';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_df34c2aff5bc737993b9cb1122f2dbd9'] = 'Vous pouvez définir une tâche cron pour ré-indexer les prix en utilisant l\'URL suivante:';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_0a82d067fe0a21871f868de1432409a5'] = 'Vous pouvez définir une tâche cron pour ré-indexer les URLs en utilisant l\'URL suivante:';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_5a12793d564ff29c49e4ab3f542dd720'] = 'Vous pouvez définir une tâche cron pour ré-indexer les attributs à l\'aide de l\'URL suivante:';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_16349835364cf839e6670b0de7da6362'] = 'Une ré-indexation nocturne est recommandée.';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_56fc8142961f1f3e9f9ec0c178881b69'] = '(En cours)';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_e1e43ed7e0922095a801341dca2f1822'] = 'Indexation des urls terminée';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_1c1783101d972ba096fff9756378b0e1'] = 'L\'indexation des urls a échoué';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_f83cc9b5e3192cbe1c40ec2effd6cbb4'] = 'Indexation des produits terminée';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_638041e8465b00f32e95eeef1d15fc77'] = '(En cours, %s produits à indexer)';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_5e123b0351f06875436de2dfde577e19'] = 'Produit d\'indexation a échoué';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_a607dc3941415ecea04bb1eb8a978962'] = 'Modèles de filtres existants';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_9923a3739235561cc50eb9446dc1771e'] = 'modèles de filtres sont configurés :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_49ee3087348e8d44e1feda1917443987'] = 'Nom';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_af1b98adf7f686b84cd0b443e022b7a0'] = 'Catégories';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_f7f19392da30e81c3abf433ce7b8ca38'] = 'Créée le';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_7dce122004969d56ae2e0245cb754d35'] = 'Modifier';
|
||||
@@ -39,6 +65,8 @@ $_MODULE['<{blocklayered}prestashop>blocklayered_2e527847e8c785f3fd99651f6400679
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_3488a51eb7f723d65daeff912e69b177'] = 'Filres sélectionnés';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_cf3cd81b30d4c4fd996ae5374fe656da'] = 'Aucun filtre sélectionné pour le moment.';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_8524de963f07201e5c086830d370797f'] = 'Chargement...';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_597c70730ebddba7d845e686665f9f28'] = 'Vous avez sélectionné - Toutes catégories-, les modèles de filtre existants seront supprimé, OK?';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_c48c42c966b3a35ad3b893e798bdec7c'] = 'Erreurs :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_74a6a547d86659933a210680efb6e6d1'] = 'Etape 3/3 - Donnez un nom à votre modèle';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_f8263d99054a4cdb3428196f078fa212'] = 'Nom du modèle :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_b96ce93c61b856a0163c116820646b19'] = 'Mon modèle';
|
||||
@@ -47,6 +75,7 @@ $_MODULE['<{blocklayered}prestashop>blocklayered_ef1094d9826e98f5417e0a37f174213
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_254f642527b45bc260048e30704edb39'] = 'Configuration';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_054b4f3ea543c990f6b125f41af6ebf7'] = 'Option';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_689202409e48743b914713f96d93947c'] = 'Valeur';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_9868c3ac0748acf3b981a96cfe163ee8'] = 'Cacher les valeurs de filtre avec aucun produit correspondant';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_8531c73de81b9ed94322dda7cf947daa'] = 'Afficher le nombre de produits qui correspondent';
|
||||
@@ -77,6 +106,6 @@ $_MODULE['<{blocklayered}prestashop>blocklayered_f09cc7ee3a9a93273f4b80601cafb00
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_2063c1608d6e0baf80249c42e2be5804'] = 'valeur';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_c32516babc5b6c47eb8ce1bfc223253c'] = 'Catalogue';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_1262d1b9fbffb3a8e85ac9e4b449e989'] = 'Filtres actifs :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_853ae90f0351324bd73ea615e6487517'] = ' :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_ea4788705e6873b424c65e91c2846b19'] = 'Annuler';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_853ae90f0351324bd73ea615e6487517'] = ' :';
|
||||
$_MODULE['<{blocklayered}prestashop>blocklayered_75954a3c6f2ea54cb9dff249b6b5e8e6'] = 'Tranche';
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
<li id="header_link_contact"><a href="{$link->getPageLink('contact', true)}" title="{l s='contact' mod='blockpermanentlinks'}">{l s='contact' mod='blockpermanentlinks'}</a></li>
|
||||
<li id="header_link_sitemap"><a href="{$link->getPageLink('sitemap')}" title="{l s='sitemap' mod='blockpermanentlinks'}">{l s='sitemap' mod='blockpermanentlinks'}</a></li>
|
||||
<li id="header_link_bookmark">
|
||||
|
||||
<script type="text/javascript">writeBookmarkLink('{$come_from}', '{$meta_title|addslashes|addslashes}', '{l s='bookmark' mod='blockpermanentlinks'}');</script>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
writeBookmarkLink('{$come_from}', '{$shop_name|addslashes|addslashes}', '{l s='bookmark this page' mod='blockpermanentlinks'}', '{$img_dir}icon/star.gif');</script>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Block permanent links module -->
|
||||
<!-- /Block permanent links module -->
|
||||
@@ -44,7 +44,7 @@ class Blockrss extends Module
|
||||
$this->displayName = $this->l('RSS feed block');
|
||||
$this->description = $this->l('Adds a block displaying an RSS feed.');
|
||||
|
||||
$this->version = '1.0';
|
||||
$this->version = '1.1';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->error = false;
|
||||
$this->valid = false;
|
||||
@@ -65,34 +65,51 @@ class Blockrss extends Module
|
||||
|
||||
if (Tools::isSubmit('submitBlockRss'))
|
||||
{
|
||||
$errors = array();
|
||||
$urlfeed = strval(Tools::getValue('urlfeed'));
|
||||
$title = strval(Tools::getValue('title'));
|
||||
$nbr = (int)(Tools::getValue('nbr'));
|
||||
|
||||
if ($urlfeed AND !Validate::isUrl($urlfeed))
|
||||
$errors[] = $this->l('Invalid feed URL');
|
||||
elseif (!$title OR empty($title) OR !Validate::isGenericName($title))
|
||||
$errors[] = $this->l('Invalid title');
|
||||
elseif (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr))
|
||||
$errors[] = $this->l('Invalid number of feeds');
|
||||
elseif (stristr($urlfeed, $_SERVER['HTTP_HOST'].__PS_BASE_URI__))
|
||||
$errors[] = $this->l('You have selected a feed URL on your own website. Please choose another URL');
|
||||
elseif (!($contents = @file_get_contents($urlfeed)))
|
||||
$errors[] = $this->l('Feed is unreacheable, check your URL');
|
||||
/* Even if the feed was reachable, We need to make sure that the feed is well formated */
|
||||
else
|
||||
{
|
||||
if (stristr($urlfeed, $_SERVER['HTTP_HOST'].__PS_BASE_URI__))
|
||||
$errors[] = $this->l('Error: You have selected a feed URL on your own website. Please choose another URL (eg. http://news.google.com/?output=rss).');
|
||||
try
|
||||
{
|
||||
$xmlFeed = new XML_Feed_Parser($contents);
|
||||
|
||||
}
|
||||
catch (XML_Feed_Parser_Exception $e)
|
||||
{
|
||||
$errors[] = $this->l('Invalid feed:').' '.$e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
if (!sizeof($errors))
|
||||
{
|
||||
Configuration::updateValue('RSS_FEED_URL', $urlfeed);
|
||||
Configuration::updateValue('RSS_FEED_TITLE', $title);
|
||||
Configuration::updateValue('RSS_FEED_NBR', $nbr);
|
||||
}
|
||||
if (isset($errors) AND sizeof($errors))
|
||||
$output .= $this->displayError(implode('<br />', $errors));
|
||||
else
|
||||
|
||||
$output .= $this->displayConfirmation($this->l('Settings updated'));
|
||||
}
|
||||
else
|
||||
$output .= $this->displayError(implode('<br />', $errors));
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors = array();
|
||||
if (stristr(Configuration::get('RSS_FEED_URL'), $_SERVER['HTTP_HOST'].__PS_BASE_URI__))
|
||||
$errors[] = $this->l('Error: You have selected a feed URL on your own website. Please choose another URL (eg. http://news.google.com/?output=rss).');
|
||||
$errors[] = $this->l('You have selected a feed URL on your own website. Please choose another URL');
|
||||
|
||||
if (sizeof($errors))
|
||||
$output .= $this->displayError(implode('<br />', $errors));
|
||||
@@ -115,7 +132,7 @@ class Blockrss extends Module
|
||||
<label>'.$this->l('Add a feed URL').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="85" name="urlfeed" value="'.htmlentities(Tools::getValue('urlfeed', Configuration::get('RSS_FEED_URL'))).'" />
|
||||
<p class="clear">'.$this->l('Add the URL of the feed you want to use').'</p>
|
||||
<p class="clear">'.$this->l('Add the URL of the feed you want to use (sample: http://news.google.com/?output=rss)').'</p>
|
||||
|
||||
</div>
|
||||
<label>'.$this->l('Number of threads displayed').'</label>
|
||||
@@ -141,10 +158,17 @@ class Blockrss extends Module
|
||||
// Getting data
|
||||
$rss_links = array();
|
||||
if ($url && ($contents = @file_get_contents($url)))
|
||||
try
|
||||
{
|
||||
if (@$src = new XML_Feed_Parser($contents))
|
||||
for ($i = 0; $i < ($nb ? $nb : 5); $i++)
|
||||
if (@$item = $src->getEntryByOffset($i))
|
||||
$rss_links[] = array('title' => $item->title, 'url' => $item->link);
|
||||
}
|
||||
catch (XML_Feed_Parser_Exception $e)
|
||||
{
|
||||
Tools::dieOrLog(Tools::displayError('Error: invalid RSS feed in blockrss module').' '.$e->getMessage(), false);
|
||||
}
|
||||
|
||||
// Display smarty
|
||||
$this->context->smarty->assign(array('title' => ($title ? $title : $this->l('RSS feed')), 'rss_links' => $rss_links));
|
||||
@@ -161,6 +185,4 @@ class Blockrss extends Module
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blockrss.css', 'all');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>blockrss</name>
|
||||
<displayName><![CDATA[RSS feed block]]></displayName>
|
||||
<version><![CDATA[1.0]]></version>
|
||||
<version><![CDATA[1.1]]></version>
|
||||
<description><![CDATA[Adds a block displaying an RSS feed.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>ebay</name>
|
||||
<displayName><![CDATA[eBay]]></displayName>
|
||||
<version><![CDATA[1.2.4]]></version>
|
||||
<version><![CDATA[1.2.5]]></version>
|
||||
<description><![CDATA[Open your shop on the eBay market place !]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[market_place]]></tab>
|
||||
|
||||
@@ -57,7 +57,7 @@ class eBayRequest
|
||||
|
||||
private $compatibilityLevel;
|
||||
|
||||
|
||||
private $debug = true;
|
||||
|
||||
/******************************************************************/
|
||||
/** Constructor And Request Methods *******************************/
|
||||
@@ -125,6 +125,14 @@ class eBayRequest
|
||||
// Close the connection
|
||||
curl_close($connection);
|
||||
|
||||
// Debug
|
||||
if ($this->debug == true)
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/log/request.php'))
|
||||
file_put_contents(dirname(__FILE__).'/log/request.php', "<?php\n\n", FILE_APPEND | LOCK_EX);
|
||||
file_put_contents(dirname(__FILE__).'/log/request.php', date('d/m/Y H:i:s')."\n\n".$request."\n\n".$response."\n\n-------------------\n\n", FILE_APPEND | LOCK_EX);
|
||||
}
|
||||
|
||||
// Return the response
|
||||
return $response;
|
||||
}
|
||||
@@ -889,6 +897,7 @@ class eBayRequest
|
||||
// Generate Variations Set
|
||||
$requestXml .= ' <VariationSpecificsSet>'."\n";
|
||||
foreach ($datas['variationsList'] as $group => $v)
|
||||
if (isset($group) && !empty($group))
|
||||
{
|
||||
$requestXml .= ' <NameValueList>'."\n";
|
||||
$requestXml .= ' <Name>'.$group.'</Name>'."\n";
|
||||
@@ -1049,7 +1058,7 @@ class eBayRequest
|
||||
$requestXml .= ' <CreateTimeFrom>'.$CreateTimeFrom.'</CreateTimeFrom>'."\n";
|
||||
$requestXml .= ' <CreateTimeTo>'.$CreateTimeTo.'</CreateTimeTo>'."\n";
|
||||
$requestXml .= ' <OrderRole>Seller</OrderRole>'."\n";
|
||||
$requestXml .= ' <OrderStatus>Completed</OrderStatus>'."\n";
|
||||
//$requestXml .= ' <OrderStatus>Completed</OrderStatus>'."\n";
|
||||
$requestXml .= ' <Pagination>'."\n";
|
||||
$requestXml .= ' <EntriesPerPage>100</EntriesPerPage>'."\n";
|
||||
$requestXml .= ' <PageNumber>'.$page.'</PageNumber>'."\n";
|
||||
|
||||
@@ -59,7 +59,7 @@ class Ebay extends Module
|
||||
{
|
||||
$this->name = 'ebay';
|
||||
$this->tab = 'market_place';
|
||||
$this->version = '1.2.4';
|
||||
$this->version = '1.2.5';
|
||||
$this->author = 'PrestaShop';
|
||||
parent::__construct ();
|
||||
$this->displayName = $this->l('eBay');
|
||||
@@ -329,7 +329,7 @@ class Ebay extends Module
|
||||
|
||||
// init Var
|
||||
$dateNew = date('Y-m-d').'T'.date('H:i:s').'.000Z';
|
||||
if (Configuration::get('EBAY_ORDER_LAST_UPDATE') < date('Y-m-d', strtotime('-45 minutes')).'T'.date('H:i:s', strtotime('-45 minutes')).'.000Z')
|
||||
if (Configuration::get('EBAY_ORDER_LAST_UPDATE') < date('Y-m-d', strtotime('-30 minutes')).'T'.date('H:i:s', strtotime('-30 minutes')).'.000Z')
|
||||
{
|
||||
// Lock
|
||||
Configuration::updateValue('EBAY_ORDER_LAST_UPDATE', $dateNew);
|
||||
@@ -351,7 +351,9 @@ class Ebay extends Module
|
||||
}
|
||||
|
||||
if ($orderList)
|
||||
foreach ($orderList as $order)
|
||||
{
|
||||
foreach ($orderList as $korder => $order)
|
||||
{
|
||||
if ($order['status'] == 'Complete' && $order['amount'] > 0.1 && isset($order['product_list']) && count($order['product_list']))
|
||||
{
|
||||
if (!Db::getInstance()->getValue('SELECT `id_ebay_order` FROM `'._DB_PREFIX_.'ebay_order` WHERE `id_order_ref` = \''.pSQL($order['id_order_ref']).'\''))
|
||||
@@ -473,10 +475,23 @@ class Ebay extends Module
|
||||
// Register the ebay order ref
|
||||
Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_order', array('id_order_ref' => pSQL($order['id_order_ref']), 'id_order' => (int)$id_order), 'INSERT');
|
||||
}
|
||||
else
|
||||
$orderList[$korder]['errors'][] = $this->l('Could not add product to cart (maybe your stock quantity is 0)');
|
||||
}
|
||||
else
|
||||
$orderList[$korder]['errors'][] = $this->l('Could not found products in database');
|
||||
}
|
||||
else
|
||||
$orderList[$korder]['errors'][] = $this->l('Invalid e-mail');
|
||||
}
|
||||
else
|
||||
$orderList[$korder]['errors'][] = $this->l('Order already imported');
|
||||
}
|
||||
else
|
||||
$orderList[$korder]['errors'][] = $this->l('Status not complete or amount less than 0.1 or no product matching');
|
||||
}
|
||||
file_put_contents(dirname(__FILE__).'/log/orders.php', "<?php\n\n".'$dateLastImport = '."'".date('d/m/Y H:i:s')."';\n\n".'$orderList = '.var_export($orderList, true).";\n\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,7 +503,12 @@ class Ebay extends Module
|
||||
|
||||
// Alias
|
||||
public function hookupdateproduct($params) { $this->hookaddproduct($params); }
|
||||
public function hookupdateProductAttribute($params) { $this->hookaddproduct($params); }
|
||||
public function hookupdateProductAttribute($params)
|
||||
{
|
||||
$id_product = Db::getInstance()->getValue('SELECT `id_product` FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product_attribute` = '.(int)$params['id_product_attribute']);
|
||||
$params['product'] = new Product($id_product);
|
||||
$this->hookaddproduct($params);
|
||||
}
|
||||
public function hookdeleteproduct($params) { $this->hookaddproduct($params); }
|
||||
public function hookheader($params) { $this->hookbackOfficeTop($params); }
|
||||
public function hookbackOfficeFooter($params) { $this->hookbackOfficeTop($params); }
|
||||
@@ -548,7 +568,7 @@ class Ebay extends Module
|
||||
|
||||
|
||||
// Displaying Information from Prestashop
|
||||
$stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 2)));
|
||||
$stream_context = @stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 2)));
|
||||
$prestashopContent = @file_get_contents('http://www.prestashop.com/partner/modules/ebay.php?version='.$this->version.'&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'®istered='.($alert['registration'] == 1 ? 'no' : 'yes').'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$this->context->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
|
||||
if (!Validate::isCleanHtml($prestashopContent))
|
||||
$prestashopContent = '';
|
||||
@@ -710,14 +730,16 @@ class Ebay extends Module
|
||||
<li id="menuTab2" class="menuTabButton">2. '.$this->l('Categories settings').'</li>
|
||||
<li id="menuTab3" class="menuTabButton">3. '.$this->l('Template manager').'</li>
|
||||
<li id="menuTab4" class="menuTabButton">4. '.$this->l('eBay Sync').'</li>
|
||||
<li id="menuTab5" class="menuTabButton">5. '.$this->l('Help').'</li>
|
||||
<li id="menuTab5" class="menuTabButton">5. '.$this->l('Orders history').'</li>
|
||||
<li id="menuTab6" class="menuTabButton">6. '.$this->l('Help').'</li>
|
||||
</ul>
|
||||
<div id="tabList">
|
||||
<div id="menuTab1Sheet" class="tabItem selected">'.$this->_displayFormParameters().'</div>
|
||||
<div id="menuTab2Sheet" class="tabItem">'.$this->_displayFormCategory().'</div>
|
||||
<div id="menuTab3Sheet" class="tabItem">'.$this->_displayFormTemplateManager().'</div>
|
||||
<div id="menuTab4Sheet" class="tabItem">'.$this->_displayFormEbaySync().'</div>
|
||||
<div id="menuTab5Sheet" class="tabItem">'.$this->_displayHelp().'</div>
|
||||
<div id="menuTab5Sheet" class="tabItem">'.$this->_displayOrdersHistory().'</div>
|
||||
<div id="menuTab6Sheet" class="tabItem">'.$this->_displayHelp().'</div>
|
||||
</div>
|
||||
<br clear="left" />
|
||||
<br />
|
||||
@@ -882,6 +904,12 @@ class Ebay extends Module
|
||||
if (!Configuration::get('EBAY_PAYPAL_EMAIL'))
|
||||
return '<p><b>'.$this->l('You have to configure "General Settings" tab before using this tab.').'</b></p><br />';
|
||||
|
||||
// Load categories only if necessary
|
||||
if (Db::getInstance()->getValue('SELECT COUNT(`id_ebay_category_configuration`) FROM `'._DB_PREFIX_.'ebay_category_configuration`') > 4 && Tools::getValue('section') != 'category')
|
||||
return '<p align="center"><b>'.$this->l('Your categories have already been configured.').'</b></p>
|
||||
<form action="index.php?tab='.$_GET['tab'].'&configure='.$_GET['configure'].'&token='.$_GET['token'].'&tab_module='.$_GET['tab_module'].'&module_name='.$_GET['module_name'].'&id_tab=2§ion=category" method="post" class="form">
|
||||
<p align="center"><input class="button" name="submitSave" type="submit" value="'.$this->l('See Categories').'" /></p></form>';
|
||||
|
||||
// Display eBay Categories
|
||||
if (!Configuration::get('EBAY_CATEGORY_LOADED'))
|
||||
{
|
||||
@@ -1358,7 +1386,7 @@ class Ebay extends Module
|
||||
|
||||
// Empty error result
|
||||
Configuration::updateValue('EBAY_SYNC_LAST_PRODUCT', 0);
|
||||
@unlink('../modules/ebay/ajax/_ebaySyncError.log.php');
|
||||
@unlink(dirname(__FILE__).'/log/syncError.php');
|
||||
|
||||
if ($_POST['ebay_sync_mode'] == 'A')
|
||||
{
|
||||
@@ -1450,10 +1478,10 @@ class Ebay extends Module
|
||||
else
|
||||
{
|
||||
echo 'OK|'.$this->displayConfirmation($this->l('Settings updated').' ('.$this->l('Option').' '.Configuration::get('EBAY_SYNC_MODE').' : '.($nbProductsTotal - $nbProductsLess).' / '.$nbProductsTotal.' '.$this->l('product(s) sync with eBay').')');
|
||||
if (file_exists('_ebaySyncError.log.php'))
|
||||
if (file_exists(dirname(__FILE__).'/log/syncError.php'))
|
||||
{
|
||||
global $tab_error;
|
||||
include('_ebaySyncError.log.php');
|
||||
include(dirname(__FILE__).'/log/syncError.php');
|
||||
foreach ($tab_error as $error)
|
||||
{
|
||||
$productsDetails = '<br /><u>'.$this->l('Product(s) concerned').' :</u>';
|
||||
@@ -1462,7 +1490,7 @@ class Ebay extends Module
|
||||
echo $this->displayError($error['msg'].'<br />'.$productsDetails);
|
||||
}
|
||||
echo '<style>#content .alert { text-align: left; width: 875px; }</style>';
|
||||
@unlink('_ebaySyncError.log.php');
|
||||
@unlink(dirname(__FILE__).'/log/syncError.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1479,10 +1507,10 @@ class Ebay extends Module
|
||||
$categoryDefaultCache = array();
|
||||
|
||||
// Get errors back
|
||||
if (file_exists('_ebaySyncError.log.php'))
|
||||
if (file_exists(dirname(__FILE__).'/log/syncError.php'))
|
||||
{
|
||||
global $tab_error;
|
||||
include('_ebaySyncError.log.php');
|
||||
include(dirname(__FILE__).'/log/syncError.php');
|
||||
}
|
||||
|
||||
// Up the time limit
|
||||
@@ -1816,10 +1844,76 @@ class Ebay extends Module
|
||||
}
|
||||
|
||||
if ($count_error > 0)
|
||||
file_put_contents('_ebaySyncError.log.php', '<?php $tab_error = '.var_export($tab_error, true).'; ?>');
|
||||
file_put_contents(dirname(__FILE__).'/log/syncError.php', '<?php $tab_error = '.var_export($tab_error, true).'; ?>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
/** Orders History Methods *******************************************/
|
||||
/******************************************************************/
|
||||
|
||||
private function _displayOrdersHistory()
|
||||
{
|
||||
// Check if the module is configured
|
||||
if (!Configuration::get('EBAY_PAYPAL_EMAIL'))
|
||||
return '<p><b>'.$this->l('You have to configure "General Settings" tab before using this tab.').'</b></p><br />';
|
||||
|
||||
|
||||
$dateLastImport = '-';
|
||||
if (file_exists(dirname(__FILE__).'/log/orders.php'))
|
||||
include(dirname(__FILE__).'/log/orders.php');
|
||||
$html = '<h2>'.$this->l('Last orders Importation').' :</h2><p><b>'.$dateLastImport.'</b></p><br /><br />
|
||||
<h2>'.$this->l('Orders History').' :</h2>';
|
||||
|
||||
if (isset($orderList) && count($orderList) > 0)
|
||||
foreach ($orderList as $order)
|
||||
{
|
||||
$html .= '<style>
|
||||
.orderImportTd1 {border-right:1px solid #000}
|
||||
.orderImportTd2 {border-right:1px solid #000;border-top:1px solid #000}
|
||||
.orderImportTd3 {border-top:1px solid #000}
|
||||
</style>
|
||||
<p>
|
||||
<b>'.$this->l('Order Ref eBay').' :</b> '.$order['id_order_ref'].'<br />
|
||||
<b>'.$this->l('Id Order Seller').' :</b> '.$order['id_order_seller'].'<br />
|
||||
<b>'.$this->l('Amount').' :</b> '.$order['amount'].'<br />
|
||||
<b>'.$this->l('Status').' :</b> '.$order['status'].'<br />
|
||||
<b>'.$this->l('Date').' :</b> '.$order['date'].'<br />
|
||||
<b>'.$this->l('E-mail').' :</b> '.$order['email'].'<br />
|
||||
<b>'.$this->l('Products').' :</b><br />';
|
||||
if (isset($order['product_list']) && count($order['product_list']) > 0)
|
||||
{
|
||||
$html .= '<table border="0" cellpadding="4" cellspacing="0"><tr>
|
||||
<td class="orderImportTd1"><b>'.$this->l('Id Product').'</b></td>
|
||||
<td class="orderImportTd1"><b>'.$this->l('Id Product Attribute').'</b></td>
|
||||
<td class="orderImportTd1"><b>'.$this->l('Quantity').'</b></td><td><b>'.$this->l('Price').'</b></td></tr>';
|
||||
foreach ($order['product_list'] as $product)
|
||||
$html .= '<tr><td class="orderImportTd2">'.$product['id_product'].'</td>
|
||||
<td class="orderImportTd2">'.$product['id_product'].'</td>
|
||||
<td class="orderImportTd2">'.$product['quantity'].'</td>
|
||||
<td class="orderImportTd3">'.$product['price'].'</td></tr>';
|
||||
$html .= '</table>';
|
||||
}
|
||||
if (isset($order['errors']) && count($order['errors']) > 0)
|
||||
{
|
||||
$html .= '<b>'.$this->l('Status Import').' :</b> KO<br />';
|
||||
$html .= '<b>'.$this->l('Failure details').' :</b><br />';
|
||||
foreach ($order['errors'] as $error)
|
||||
$html .= $error.'t<br />';
|
||||
}
|
||||
else
|
||||
$html .= '<b>'.$this->l('Status Import').' :</b> OK';
|
||||
$html .= '</p><br />';
|
||||
}
|
||||
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
/** Help Config Methods *******************************************/
|
||||
/******************************************************************/
|
||||
|
||||
@@ -9,6 +9,11 @@ $_MODULE['<{ebay}prestashop>ebay_8acabcc788c316f92b7850c76265b49b'] = 'Vous deve
|
||||
$_MODULE['<{ebay}prestashop>ebay_d591cbc447d01e5a6165096ebfdf804e'] = 'Vous devez activer l\'extension cURL sur votre serveur si vous désirez utiliser ce module.';
|
||||
$_MODULE['<{ebay}prestashop>ebay_1b18bd5d9d85f4f667614345ee20e3b2'] = 'Vous devez activer l\'option allow_url_fopen sur votre serveur si vous désirez utiliser ce module.';
|
||||
$_MODULE['<{ebay}prestashop>ebay_8e64bc164aee46723ed2d70273c6f8ab'] = 'Vous devez enregistrer le module sur eBay';
|
||||
$_MODULE['<{ebay}prestashop>ebay_5f8d9c30e0606a91c5d7b6e1bf1217ac'] = 'N\'a pas pu ajouté les produits au panier (peut être votre stock est il à 0)';
|
||||
$_MODULE['<{ebay}prestashop>ebay_25fff46a6fe5b9512e2f4054f4ff6060'] = 'N\'a pas pu trouvé les produits dans votre catalogue';
|
||||
$_MODULE['<{ebay}prestashop>ebay_eaa0d1591e6369a298dcd6cb1a8eba8a'] = 'E-mail invalide';
|
||||
$_MODULE['<{ebay}prestashop>ebay_a11a07346e4343b393b7a6d29924043e'] = 'Commande déjà importé';
|
||||
$_MODULE['<{ebay}prestashop>ebay_2e7adc61fa0cedcf1d442feafbaea1de'] = 'Le statut n\'est pas à \"Complete\" ou le montant de la commande est inférieur à 0.1 ou aucun produit n\'a pu être trouvé dans votre catalogue';
|
||||
$_MODULE['<{ebay}prestashop>ebay_98f54d8bba6523829eeb8fd7ab9a2088'] = 'Continuer quand même ?';
|
||||
$_MODULE['<{ebay}prestashop>ebay_2e4f4d8b849fb72905addc231d160e8b'] = 'Status du module eBay';
|
||||
$_MODULE['<{ebay}prestashop>ebay_85f9d92e0551772437b934b7222d63cb'] = 'Le module eBay est fonctionnel.';
|
||||
@@ -25,6 +30,7 @@ $_MODULE['<{ebay}prestashop>ebay_3225a10b07f1580f10dee4abc3779e6c'] = 'Paramètr
|
||||
$_MODULE['<{ebay}prestashop>ebay_dc2f736ed903b4f6f72a36b763cd7717'] = 'Configuration des catégories';
|
||||
$_MODULE['<{ebay}prestashop>ebay_0f5f872ba4c6575319e6beee6ebcc481'] = 'Template de la fiche produit';
|
||||
$_MODULE['<{ebay}prestashop>ebay_47ba6504eb5b1e3a95ea3dbd960904db'] = 'Mise en ligne des produits';
|
||||
$_MODULE['<{ebay}prestashop>ebay_1a6f6b88447d4c3a86da93913a1b844d'] = 'Historique des commandes';
|
||||
$_MODULE['<{ebay}prestashop>ebay_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide';
|
||||
$_MODULE['<{ebay}prestashop>ebay_e5beb503fe9553f0ed5be3c324fc9cb7'] = 'Pour exporter vos produits sur eBay, vous devez créer un compte pro sur eBay (voir la partie Aide) et configurer le module eBay-Prestashop.';
|
||||
$_MODULE['<{ebay}prestashop>ebay_230b8b5e65ef7731d72a42b1ddb0293f'] = 'Identifiant eBay';
|
||||
@@ -49,6 +55,8 @@ $_MODULE['<{ebay}prestashop>ebay_458d329d5eb1caf63615141fb51e8329'] = 'Votre cod
|
||||
$_MODULE['<{ebay}prestashop>ebay_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{ebay}prestashop>ebay_b9284bff13acffdd879ef4ac7fca5234'] = 'Configuration non mise à jour.';
|
||||
$_MODULE['<{ebay}prestashop>ebay_67e19ffdaa0a11e69349810403a9727e'] = 'Vous devez configurer l\'onglet \"Paramètres\" avant d\'utiliser cet onglet.';
|
||||
$_MODULE['<{ebay}prestashop>ebay_0706a152f5e26f0cbce3de5269c54f30'] = 'Vos catégories ont déjà été configurés';
|
||||
$_MODULE['<{ebay}prestashop>ebay_2b827fb3fb7f3fb4304b286764b18f1e'] = 'Voir les catégories';
|
||||
$_MODULE['<{ebay}prestashop>ebay_1fe6b0032a7882ef20d08a5386441e33'] = 'Pour mettre en ligne vos produits sur eBay, vous devez associer chacune des catégories de votre boutique à une catégorie eBay. Vous pouvez également définir une variation du prix sur eBay.';
|
||||
$_MODULE['<{ebay}prestashop>ebay_1bffdb0b10182ea51f7baa97ee2d19a8'] = 'Vous pouvez utiliser le bouton ci-dessous pour associer automatiquement les catégories qui n\'ont pas encore d\'association avec des catégories suggérées par eBay.';
|
||||
$_MODULE['<{ebay}prestashop>ebay_36be9eda23888bf12f74d6cd9d46ba1d'] = 'Suggérer des catégories';
|
||||
@@ -81,3 +89,18 @@ $_MODULE['<{ebay}prestashop>ebay_caab0e2c2f3ae0d242b0b36f22d9acc5'] = 'Vous alle
|
||||
$_MODULE['<{ebay}prestashop>ebay_70b240eb3db5174e1c9520cabe2ae781'] = 'produits sur eBay. Voulez-vous confirmer ?';
|
||||
$_MODULE['<{ebay}prestashop>ebay_547c708291fe196592dd1e4db7b206a5'] = 'produit(s) mis en ligne sur eBay';
|
||||
$_MODULE['<{ebay}prestashop>ebay_1761efb946aa43c14af989665dae691a'] = 'Produit(s) concerné(s)';
|
||||
$_MODULE['<{ebay}prestashop>ebay_04a338309915f11c8b8052a1c1ff7d84'] = 'Dernière importation des commandes';
|
||||
$_MODULE['<{ebay}prestashop>ebay_45ad2eef89200b7037c5062688740213'] = 'Historiques des commandes';
|
||||
$_MODULE['<{ebay}prestashop>ebay_1b5f52a88052dce1423a8c0cb19d6ee9'] = 'Référence commande eBay';
|
||||
$_MODULE['<{ebay}prestashop>ebay_af63fd747d7a33367a4399d0c21c30d3'] = 'Référence commande vendeur';
|
||||
$_MODULE['<{ebay}prestashop>ebay_b2f40690858b404ed10e62bdf422c704'] = 'Montant';
|
||||
$_MODULE['<{ebay}prestashop>ebay_ec53a8c4f07baed5d8825072c89799be'] = 'Statut';
|
||||
$_MODULE['<{ebay}prestashop>ebay_44749712dbec183e983dcd78a7736c41'] = 'Date';
|
||||
$_MODULE['<{ebay}prestashop>ebay_1e884e3078d9978e216a027ecd57fb34'] = 'E-mail';
|
||||
$_MODULE['<{ebay}prestashop>ebay_068f80c7519d0528fb08e82137a72131'] = 'Produits';
|
||||
$_MODULE['<{ebay}prestashop>ebay_2bff0c18dad806b7e121a0013c7f08a6'] = 'Identifiant produit';
|
||||
$_MODULE['<{ebay}prestashop>ebay_b86883a8dc6c44cb39371e3b7aea594f'] = 'Identifiant attribut produit';
|
||||
$_MODULE['<{ebay}prestashop>ebay_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantité';
|
||||
$_MODULE['<{ebay}prestashop>ebay_3601146c4e948c32b6424d2c0a7f0118'] = 'Prix';
|
||||
$_MODULE['<{ebay}prestashop>ebay_eacb7a77450c68e3936ff0475c010cdb'] = 'Status de l\'import';
|
||||
$_MODULE['<{ebay}prestashop>ebay_59fc75ecf1ce372c9ed534d5e545ff88'] = 'Détails de l\'échec de l\'import';
|
||||
|
||||
2
modules/ebay/log/.htaccess
Executable file
2
modules/ebay/log/.htaccess
Executable file
@@ -0,0 +1,2 @@
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
36
modules/ebay/log/index.php
Executable file
36
modules/ebay/log/index.php
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 6594 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -4864,7 +4864,7 @@
|
||||
</binding>
|
||||
<service name="RateService">
|
||||
<port name="RateServicePort" binding="ns:RateServiceSoapBinding">
|
||||
<s1:address location="https://wsbeta.fedex.com:443/web-services/rate"/>
|
||||
<s1:address location="https://gateway.fedex.com:443/web-services/rate"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>fedexcarrier</name>
|
||||
<displayName><![CDATA[Fedex Carrier]]></displayName>
|
||||
<version><![CDATA[1.2]]></version>
|
||||
<version><![CDATA[1.2.1]]></version>
|
||||
<description><![CDATA[Offer your customers, different delivery methods with Fedex]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[shipping_logistics]]></tab>
|
||||
|
||||
@@ -56,7 +56,7 @@ class FedexCarrier extends CarrierModule
|
||||
{
|
||||
$this->name = 'fedexcarrier';
|
||||
$this->tab = 'shipping_logistics';
|
||||
$this->version = '1.2';
|
||||
$this->version = '1.2.1';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->limited_countries = array('us');
|
||||
|
||||
|
||||
@@ -19,10 +19,13 @@ $_MODULE['<{gcheckout}prestashop>gcheckout_4402acab1c8f90dcf4a31dc96833bd86'] =
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_82b8bb0d807e6d2e43a068f954c3559f'] = 'L\'ID marchand semble incorrect';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_9dd37c2106ceacbf0a40778b2109c386'] = 'La clé marchand semble incorrecte';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_cd1c5e22d4513c1912be45c9ce9ddbe2'] = 'La version de l\'API utilisée par ce module est la 2.0';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_a1ffd2dc2538ea3093532029514d42ac'] = 'Utilisez le mode bac à sable pour tester le module avant de l\'utiliser en mode réel. N\'oubliez pas de changer vos clés et ID marchand selon le mode !';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_650be61892bf690026089544abbd9d26'] = 'Mode';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_7f80fcc452c2f1ed2bb51b39d0864df1'] = 'Réel';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_2652eec977dcb2a5aea85f5bec235b05'] = 'Bac à sable';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_96fb435ae559f8a759f22f0823d57f7d'] = 'Ne pas oublier de spécifier la devise utilisée dans les onglets de paiement dans la partie de devises';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_386c339d37e737a436499d423a77df0c'] = 'Devises';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_76055653a95e0a559b734ec322d89632'] = 'Vous trouverez ces identifiants dans votre compte Google Checkout > Settings > Integration. Les modes réel et bac à sable ont tous les deux besoin de ces clés.';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_229a7ec501323b94db7ff3157a7623c9'] = 'ID marchand';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_795acb9a0c89791314d3032fe65eeb92'] = 'Clé marchand';
|
||||
|
||||
@@ -12,3 +12,11 @@ $_MODULE['<{importerosc}prestashop>importerosc_a89a64592edf58aee0fc749735902cea'
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_375e6e17d4bd18a5163d3a7d13b80b4b'] = 'Merci de choisir la devise par défaut';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_294f0969b5f80f1bae24a7183eb338d5'] = 'Merci de choisir l\'url de la boutique';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_86545d77ce5790e924190d9b5a7ac1b6'] = 'Group par défaut OsCommerce';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_9aa1b03934893d7134a660af4204f2a9'] = 'Serveur';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_770b2f7556eecbe5000cfcbddc9f9885'] = '(Ex: mysql.mydomain.com)';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_8f9bfe9d1345237cb3b2b205864da075'] = 'Utilisateur';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_dc647eb65e6711e155375218212b3964'] = 'Mot de passe';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_14ae0ea02f571a833786d13d9ca6a897'] = '(Mot de passe peut être vide)';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_e307db07b3975fef922a80d07455ee5e'] = 'Base de données';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_dac130bdd2c5492a8108a4145bd9f04a'] = 'Préfixe base de données';
|
||||
$_MODULE['<{importerosc}prestashop>importerosc_6bdc02625540b5264cffe801c37a82dd'] = '(Le préfixe est optionnel. Si toute votre base de données commence par \"pref_\", votre préfixe est \"pref_\")';
|
||||
|
||||
@@ -47,7 +47,7 @@ class importerosc extends ImportModule
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install() OR !$this->registerHook('beforeAuthentication'))
|
||||
if (!parent::install() || !$this->registerHook('beforeAuthentication'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -64,26 +64,23 @@ class importerosc extends ImportModule
|
||||
$langagues = $this->ExecuteS('SELECT * FROM `'.addslashes($this->prefix).'languages`');
|
||||
$curencies = $this->ExecuteS('SELECT * FROM `'.addslashes($this->prefix).'currencies`');
|
||||
|
||||
$html = '<label style="width:220px">'.$this->l('Default osCommerce language').' : </label>
|
||||
$html = '<label style=\'width:220px\'>'.$this->l('Default osCommerce language : ').'</label>
|
||||
<div class="margin-form">
|
||||
<select name="defaultOscLang"><option value="0">------</option>';
|
||||
<select name=\'defaultOscLang\'><option value=\'0\'>------</option>';
|
||||
foreach($langagues AS $lang)
|
||||
$html .= '<option value="'.$lang['languages_id'].'">'.$lang['name'].'</option>';
|
||||
$html .= '</select></div>
|
||||
<label style="width:220px">'.$this->l('Default osCommerce currency').' : </label>
|
||||
<div class="margin-form">
|
||||
<select name="defaultOscCurrency"><option value="0">------</option>';
|
||||
<label style=\'width:220px\'>'.$this->l('Default osCommerce currency : ').'</label>
|
||||
<div class=\'margin-form\'>
|
||||
<select name=\'defaultOscCurrency\'><option value=\'0\'>------</option>';
|
||||
foreach($curencies AS $curency)
|
||||
$html .= '<option value="'.$curency['currencies_id'].'">'.$curency['title'].'</option>';
|
||||
$html .= '<option value=\''.$curency['currencies_id'].'\'>'.$curency['title'].'</option>';
|
||||
$html .= '</select></div>';
|
||||
$html .= '<label style="width:220px">'.$this->l('Shop url').' : </label>
|
||||
<div class="margin-form">
|
||||
$html .= '<label style=\'width:220px\'>'.$this->l('Shop url : ').'</label>
|
||||
<div class=\'margin-form\'>
|
||||
http://<input type="text" name="shop_url">/
|
||||
<p>'.$this->l('Specify the root URL of your site oscommerce').'</p>
|
||||
</div>';
|
||||
|
||||
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,11 @@ $_MODULE['<{loyalty}prestashop>loyalty_ade45d72ab6ba1ab576d8b9deb0c2438'] = 'Poi
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_9611a682e61c503c32e2dc58fdbc8ddf'] = 'Points annulés au statut suivant';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_2a46cccdea2f18fdfdfacf99a98b758d'] = 'Les bons de réductions crées par le système de fidélité peuvent être utilisés dans les catégories d\'articles suivantes :';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_ef7de3f485174ff47f061ad27d83d0ee'] = 'sélectionné';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_b56c3bda503a8dc4be356edb0cc31793'] = 'Réduire tout';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_5ffd7a335dd836b3373f5ec570a58bdc'] = 'Ouvrir tout';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_5e9df908eafa83cb51c0a3720e8348c7'] = 'Cocher tout';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_9747d23c8cc358c5ef78c51e59cd6817'] = 'Décocher tout';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_c2a7db7dec4de1bdb143ccd790f5a62c'] = 'Cocher pour quelle(s) catégorie(s) seront utilisables les bons de réductions fidélité';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_30e793698766edbaaf84a74d4c377f72'] = 'Statuts des points de fidélité';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_4f2a91e15af2631ff9424564b8a45fb2'] = 'Initial';
|
||||
|
||||
@@ -291,9 +291,7 @@ class MailAlerts extends Module
|
||||
$params['product'] = get_object_vars($params['product']);
|
||||
|
||||
if (is_array($params['product']['name']))
|
||||
{
|
||||
$params['product']['name'] = $params['product']['name'][(int)Configuration::get('PS_LANG_DEFAULT')];
|
||||
}
|
||||
|
||||
if (isset($params['product']['id_product']))
|
||||
$params['product']['id'] = (int)$params['product']['id_product'];
|
||||
|
||||
@@ -33,10 +33,6 @@
|
||||
*/
|
||||
|
||||
require_once(realpath(dirname(__FILE__).'/../../config/config.inc.php'));
|
||||
|
||||
if (Tools::getValue('mrtoken') != sha1('mr'._COOKIE_KEY_.'mrAgain'))
|
||||
die();
|
||||
|
||||
require_once(realpath(dirname(__FILE__).'/../../init.php'));
|
||||
require(dirname(__FILE__).'/mondialrelay.php');
|
||||
require(dirname(__FILE__).'/classes/MRCreateTickets.php');
|
||||
@@ -44,10 +40,30 @@ require(dirname(__FILE__).'/classes/MRGetTickets.php');
|
||||
require(dirname(__FILE__).'/classes/MRGetRelayPoint.php');
|
||||
require(dirname(__FILE__).'/classes/MRManagement.php');
|
||||
|
||||
MondialRelay::initModuleAccess();
|
||||
|
||||
// Access page List liable to the generated token
|
||||
$accessPageList = array(
|
||||
MondialRelay::getToken('front') => array(
|
||||
'MRGetRelayPoint',
|
||||
'addSelectedCarrierToDB'),
|
||||
MondialRelay::getToken('back') => array(
|
||||
'MRGetTickets',
|
||||
'MRCreateTickets',
|
||||
'MRDeleteHistory',
|
||||
'uninstallDetail',
|
||||
'DeleteHistory'));
|
||||
|
||||
$method = Tools::getValue('method');
|
||||
$token = Tools::getValue('mrtoken');
|
||||
$params = array();
|
||||
$result = array();
|
||||
|
||||
// If the method name assoacited to the token received doesn't match with
|
||||
// the list, then we kill the request
|
||||
if (!isset($accessPageList[$token]) || !in_array($method, $accessPageList[$token]))
|
||||
exit();
|
||||
|
||||
// Method name allow to instanciate his object to properly call the
|
||||
// implemented interface method and do his job
|
||||
switch($method)
|
||||
@@ -112,4 +128,4 @@ catch(Exception $e)
|
||||
}
|
||||
echo MondialRelay::jsonEncode($result);
|
||||
exit(0);
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -48,6 +48,7 @@ $_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd9751221528
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Configuration du Module Mondial Relay';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'Pour créer un transporteur Mondial Relay';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Remplissez et sauvegarder vos paramètres Mondial Relay';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_94fbe32464fcfa902feed9f256439833'] = 'Créer un transporteur utilisant le formulaire \"ajouter un transporteur\" ci-dessous';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Definissez un prix pour votre transporteur sur';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'La page Transporteurs';
|
||||
$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Pour générer vos étiquettes, vous devez avoir enregistré une adresse valide de votre boutique sur votre';
|
||||
|
||||
@@ -59,7 +59,6 @@ function getTickets(detailedExpeditionList)
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
//console.log(thrownError);
|
||||
displayBackGenerateSubmitButton();
|
||||
}
|
||||
});
|
||||
@@ -311,7 +310,6 @@ function PS_MRGetUninstallDetail()
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
//console.log(thrownError);
|
||||
// Put debug to see error detail
|
||||
}
|
||||
});
|
||||
@@ -363,7 +361,6 @@ function PS_MRBackupDatabase()
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
//console.log(thrownError);
|
||||
// Put debug to see error detail
|
||||
}
|
||||
});
|
||||
@@ -387,13 +384,9 @@ function PS_MRAddSelectedRelayPointInDB(relayPointNumber, id_carrier)
|
||||
'mrtoken' : mrtoken},
|
||||
success: function(json)
|
||||
{
|
||||
// console.log(json);
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
//console.log(xhr);
|
||||
//console.log(thrownError);
|
||||
//console.log(ajaxOptions);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -415,13 +408,9 @@ function PS_MRAddSelectedCarrierInDB(id_carrier)
|
||||
'mrtoken' : mrtoken},
|
||||
success: function(json)
|
||||
{
|
||||
//console.log(json);
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
//console.log(xhr);
|
||||
//console.log(thrownError);
|
||||
//console.log(ajaxOptions);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -521,7 +510,6 @@ function PS_MRDisplayErrorRelayPoint(errorList, blockContent)
|
||||
|
||||
blockContent.fadeOut('fast', function()
|
||||
{
|
||||
console.log($(this));
|
||||
$(this).children('td').html('');
|
||||
for (numError in errorList)
|
||||
{
|
||||
@@ -564,7 +552,6 @@ function PS_MRFetchRelayPoint(carrierSelected)
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
//console.log(thrownError);
|
||||
// Put debug to see error detail
|
||||
}
|
||||
});
|
||||
@@ -607,6 +594,10 @@ function PS_MRGetRelayPoint(carrierSelected)
|
||||
*/
|
||||
function PS_MRCreateGmap(id_carrier)
|
||||
{
|
||||
// This has been write this way because it needed to have a known block
|
||||
// present everytime in the page. Body is the only one sure.
|
||||
// It's an hidden block it's replaced in the good block when user select his
|
||||
// own carrier
|
||||
$('body').prepend('\
|
||||
<tr id="PS_MRGmapDefaultPosition_' + id_carrier + '" class="PS_MRGmapDefaultPosition">\
|
||||
<td colspan="4"> \
|
||||
|
||||
@@ -39,7 +39,8 @@ class MondialRelay extends Module
|
||||
|
||||
public static $modulePath = '';
|
||||
public static $moduleURL = '';
|
||||
static public $MRToken = '';
|
||||
static public $MRFrontToken = '';
|
||||
static public $MRBackToken = '';
|
||||
|
||||
// Added for 1.3 compatibility
|
||||
const ONLY_PRODUCTS = 1;
|
||||
@@ -171,6 +172,15 @@ class MondialRelay extends Module
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the token depend of the type
|
||||
*/
|
||||
static public function getToken($type = 'front')
|
||||
{
|
||||
return ($type == 'front') ? self::$MRFrontToken : (($type == 'back') ?
|
||||
self::$MRBackToken : NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
** Register hook depending of the Prestashop version used
|
||||
*/
|
||||
@@ -366,7 +376,8 @@ class MondialRelay extends Module
|
||||
public static function initModuleAccess()
|
||||
{
|
||||
self::$modulePath = _PS_MODULE_DIR_. 'mondialrelay/';
|
||||
self::$MRToken = sha1('mr'._COOKIE_KEY_.'mrAgain');
|
||||
self::$MRFrontToken = sha1('mr'._COOKIE_KEY_.'Front');
|
||||
self::$MRBackToken = sha1('mr'._COOKIE_KEY_.'Back');
|
||||
|
||||
$protocol = (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS'])
|
||||
&& strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
|
||||
@@ -409,7 +420,7 @@ class MondialRelay extends Module
|
||||
<link type="text/css" rel="stylesheet" href="'.$cssFilePath.'" />
|
||||
<script type="text/javascript">
|
||||
var _PS_MR_MODULE_DIR_ = "'.self::$moduleURL.'";
|
||||
var mrtoken = "'.self::$MRToken.'";
|
||||
var mrtoken = "'.self::$MRBackToken.'";
|
||||
</script>
|
||||
<script type="text/javascript" src="'.$jsFilePath.'"></script>';
|
||||
}
|
||||
@@ -613,7 +624,7 @@ class MondialRelay extends Module
|
||||
$this->context->smarty->assign( array(
|
||||
'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0),
|
||||
'new_base_dir' => self::$moduleURL,
|
||||
'MRToken' => self::$MRToken,
|
||||
'MRToken' => self::$MRFrontToken,
|
||||
'carriersextra' => $carriersList));
|
||||
|
||||
return $this->display(__FILE__, 'mondialrelay.tpl');
|
||||
|
||||
@@ -44,9 +44,11 @@ $_MODULE['<{moneybookers}prestashop>moneybookers_3513f0ecb96b6c959454534578ee140
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_64d37ad3bf2f0aee7c8a321321c7e9d9'] = 'J\'ai déjà un compte Moneybookers';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_b0e8c8326985417a5efdd6649f02e385'] = 'Grâce au partenariat PrestaShop/Moneybookers,';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_d5086eeb1bc1994c5abf945fd79d4246'] = 'vous bénéficierez d\'un taux de commission préférentiel !';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_fd90882b9b7c8653dd645f5e986b5402'] = 'Frais disponible depuis le 21 mars 2011';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_68db2cda800ddb2ae307c60b0a96252f'] = 'Solution de Paiement en ligne Moneybookers';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_b9c758264b134743b13a85ca4055c629'] = 'Estimation du volume mensuel passant par Moneybookers';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_7d294d4900ff1a38f5b0a89612916eac'] = 'Pour les marchands au-dessus de €100,000 des tarifs sur mesure peuvent être mis en place.';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_1467fcd161d2aee8146c7808c9377852'] = 'Pour voir la dernière mise à jour des frais détaillés';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_936ccdb97115e9f35a11d35e3d5b5cad'] = 'Cliquez ici';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_11c8ff1cde03aa19406dfe5971b92553'] = 'Porte-monnaie électronique Moneybookers';
|
||||
$_MODULE['<{moneybookers}prestashop>moneybookers_223b661f7b13d33498a9274bb10e3538'] = 'Portail de Paiements Directs Moneybookers ';
|
||||
|
||||
@@ -184,7 +184,7 @@ class MoneyBookers extends PaymentModule
|
||||
$contextOptions = $defaultContextOptions;
|
||||
|
||||
// Create a stream context
|
||||
$stream_context = stream_context_create($contextOptions);
|
||||
$stream_context = @stream_context_create($contextOptions);
|
||||
|
||||
if (($fp = @fopen($url, $mode, false, $stream_context)))
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ $_MODULE = array();
|
||||
$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_251295238bdf7693252f2804c8d3707e'] = 'Pages introuvables';
|
||||
$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3ae7050d9f8502e9b69448a6db73fab2'] = 'Affiche les pages demandées mais qui n\'existent pas';
|
||||
$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_50004bd606668bb842e80f51337b765d'] = 'Pages introuvables supprimées';
|
||||
$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_23dbe39a97cb7e4e528f25f5795d317f'] = 'Pages non trouvées ont été supprimés.';
|
||||
$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6cb944288ac528fcfd76b20156dddce1'] = 'Vous devez utiliser un fichier .htaccess redirigeant les erreurs 404 vers la page \"404.php\"';
|
||||
$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_193cfc9be3b995831c6af2fea6650e60'] = 'Page';
|
||||
$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_b6f05e5ddde1ec63d992d61144452dfa'] = 'Origine';
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{paysafecard}prestashop>prepaidservices_3e8e30e75887d2f3b02da669ebd5b380'] = 'Un certificat a été trouvé pour cette configuration';
|
||||
$_MODULE['<{paysafecard}prestashop>prepaidservices_515f3d11e66f6fc5f7bb453e6030241a'] = 'Un mot de passe a déjà été enregistré';
|
||||
$_MODULE['<{paysafecard}prestashop>disposition-error_393988def796f78c4b673b90548f3afa'] = 'La disposition est dans un état invalide';
|
||||
$_MODULE['<{paysafecard}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = '. Vous n\'êtes pas authorisé à récupérer le paiement.';
|
||||
$_MODULE['<{paysafecard}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Payer avec';
|
||||
|
||||
@@ -583,7 +583,7 @@ class PrestaFraud extends Module
|
||||
}
|
||||
elseif (function_exists('file_get_contents'))
|
||||
{
|
||||
$stream_context = stream_context_create(array('http' => array('timeout' => 5)));
|
||||
$stream_context = @stream_context_create(array('http' => array('timeout' => 5)));
|
||||
return file_get_contents($this->_trustUrl.'?xml='.urlencode(str_replace("\r", "\n", '', $datas)), $stream_context);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -783,8 +783,13 @@ class ProductComments extends Module
|
||||
{
|
||||
foreach ($criterions AS $criterion)
|
||||
{
|
||||
if(isset($grades[$criterion['id_product_comment_criterion']]))
|
||||
{
|
||||
$list_product_grades[$criterion['id_product_comment_criterion']][$id_product] = $grades[$criterion['id_product_comment_criterion']];
|
||||
$grade_total += (float)($grades[$criterion['id_product_comment_criterion']]);
|
||||
}
|
||||
else
|
||||
$list_product_grades[$criterion['id_product_comment_criterion']][$id_product] = 0;
|
||||
|
||||
if (!array_key_exists($criterion['id_product_comment_criterion'], $list_grades))
|
||||
$list_grades[$criterion['id_product_comment_criterion']] = $criterion['name'];
|
||||
|
||||
@@ -28,19 +28,23 @@
|
||||
<script type="text/javascript" src="{$module_dir}js/jquery.rating.pack.js"></script>
|
||||
<script type="text/javascript" src="{$smarty.const._PS_JS_DIR_}jquery/jquery.cluetip.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){literal}{{/literal} $('input[@type=radio].star').rating(); {literal}}{/literal});
|
||||
$(function(){literal}{{/literal}
|
||||
$('.auto-submit-star').rating({literal}{{/literal}
|
||||
callback: function(value, link){literal}{{/literal}
|
||||
{literal}}{/literal}
|
||||
{literal}}{/literal});
|
||||
{literal}}{/literal});
|
||||
{literal}
|
||||
$(function()
|
||||
{
|
||||
$('input[@type=radio].star').rating();
|
||||
});
|
||||
$(function()
|
||||
{
|
||||
$('.auto-submit-star').rating();
|
||||
});
|
||||
|
||||
//close comment form
|
||||
function closeCommentForm(){ldelim}
|
||||
function closeCommentForm()
|
||||
{
|
||||
$('#sendComment').slideUp('fast');
|
||||
$('input#addCommentButton').fadeIn('slow');
|
||||
{rdelim}
|
||||
}
|
||||
{/literal}
|
||||
</script>
|
||||
|
||||
<tr class="comparison_header">
|
||||
@@ -64,7 +68,7 @@
|
||||
<td width="{$width}%" class="{$classname} comparison_infos ajax_block_product" align="center">
|
||||
{if isset($tab_grade[$id_product]) AND $tab_grade[$id_product]}
|
||||
{section loop=6 step=1 start=1 name=average}
|
||||
<input class="auto-submit-star" disabled="disabled" type="radio" name="{$grade_id}_{$product_id}_{$smarty.section.average.index}" {if isset($tab_grade[$id_product]) AND $tab_grade[$id_product]|round neq 0 and $smarty.section.average.index eq $tab_grade[$id_product]|round}checked="checked"{/if} />
|
||||
<input class="auto-submit-star" disabled="disabled" type="radio" name="{$grade_id}_{$id_product}_{$smarty.section.average.index}" {if isset($tab_grade[$id_product]) AND $tab_grade[$id_product]|round neq 0 and $smarty.section.average.index eq $tab_grade[$id_product]|round}checked="checked"{/if} />
|
||||
{/section}
|
||||
{else}
|
||||
-
|
||||
@@ -101,7 +105,7 @@
|
||||
<div class="comment">
|
||||
<div class="customer_name">
|
||||
{dateFormat date=$comment.date_add|escape:'html':'UTF-8' full=0}
|
||||
{$comment.firstname|escape:'html':'UTF-8'} {$comment.lastname|truncate:30:'...'|escape:'htmlall':'UTF-8'}.
|
||||
{$comment.customer_name|escape:'html':'UTF-8'}.
|
||||
</div>
|
||||
{$comment.content|escape:'html':'UTF-8'|nl2br}
|
||||
</div>
|
||||
|
||||
@@ -5,10 +5,12 @@ include_once('../../init.php');
|
||||
include_once('../../modules/shopimporter/shopimporter.php');
|
||||
ini_set('display_errors', 'off');
|
||||
|
||||
if (!Tools::getValue('ajax') OR Tools::getValue('token') != sha1(_COOKIE_KEY_.'ajaxShopImporter'))
|
||||
$moduleName = Tools::getValue('moduleName');
|
||||
|
||||
if (!Tools::getValue('ajax') || Tools::getValue('token') != sha1(_COOKIE_KEY_.'ajaxShopImporter') || !ctype_alnum($moduleName))
|
||||
die;
|
||||
|
||||
$moduleName = Tools::getValue('moduleName');
|
||||
|
||||
$className = Tools::getValue('className');
|
||||
$getMethod = Tools::getValue('getMethod');
|
||||
$limit = Tools::getValue('limit');
|
||||
@@ -69,7 +71,7 @@ if (Tools::isSubmit('getData') || Tools::isSubmit('syncLang') || Tools::isSubmit
|
||||
{
|
||||
$return = call_user_func_array(array($importModule, $getMethod), array($limit, $nbr_import));
|
||||
$shopImporter = new shopImporter();
|
||||
$shopImporter->generiqueImport($className, $return, (bool)$save);
|
||||
$shopImporter->genericImport($className, $return, (bool)$save);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +95,7 @@ if (Tools::isSubmit('getDataWS') || Tools::isSubmit('syncLangWS') || Tools::isSu
|
||||
{
|
||||
$return = call_user_func_array(array($importModule, $getMethod), array($limit, $nbr_import));
|
||||
$shopImporter = new shopImporter();
|
||||
$shopImporter->generiqueImport($className, $return, (bool)$save);
|
||||
$shopImporter->genericImport($className, $return, (bool)$save);
|
||||
}
|
||||
die('{"hasError" : false, "error" : []}');
|
||||
} catch (Exception $e)
|
||||
|
||||
@@ -47,6 +47,7 @@ $_MODULE['<{shopimporter}prestashop>shopimporter_782c8b38bce4f2f6975ca7f33ac8189
|
||||
$_MODULE['<{shopimporter}prestashop>shopimporter_f2931b8b1622867fcc461d7de388e319'] = 'Import des historique de commande';
|
||||
$_MODULE['<{shopimporter}prestashop>shopimporter_32a6deec3cca312a54d6b8769c9b8dd7'] = 'n\'est pas disponible dans ce module';
|
||||
$_MODULE['<{shopimporter}prestashop>shopimporter_1e411d25230ba738b9ae583bcb9b0b57'] = 'Connexion à la base de données OK ';
|
||||
$_MODULE['<{shopimporter}prestashop>shopimporter_472f0b8c78cc382302e094c94856c951'] = 'La connexion au service Web est OK';
|
||||
$_MODULE['<{shopimporter}prestashop>shopimporter_3596c777cbc8b72d678f34daabc9148b'] = 'Afficher les erreurs';
|
||||
$_MODULE['<{shopimporter}prestashop>shopimporter_89a399eee52b2a6daaea92eba3e14cad'] = 'Lancer le test d\'import';
|
||||
$_MODULE['<{shopimporter}prestashop>shopimporter_bf79359f8edda6f7df97ef57a4ee09b6'] = 'Lancer l\'import';
|
||||
|
||||
@@ -27,7 +27,6 @@ var shopImporter = {
|
||||
|
||||
syncLangWS : function (onComplete)
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '../modules/shopimporter/ajax.php',
|
||||
@@ -45,7 +44,6 @@ var shopImporter = {
|
||||
}
|
||||
else
|
||||
onComplete(true);
|
||||
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
@@ -75,7 +73,6 @@ var shopImporter = {
|
||||
}
|
||||
else
|
||||
onComplete(true);
|
||||
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
@@ -99,13 +96,12 @@ var shopImporter = {
|
||||
{
|
||||
if (jsonData.hasError)
|
||||
{
|
||||
$('#steps').html('<div id="currency_feedback" style="display:none;" class="error"><img src="'+shopImporter.srcError+'">'+jsonData.error+'</div>');
|
||||
$('#steps').html('<div id=\'currency_feedback\' style=\'display:none;\' class=\'error\'><img src=\''+shopImporter.srcError+'\'>'+jsonData.error+'</div>');
|
||||
$('#currency_feedback').fadeIn('slow');
|
||||
onComplete(false);
|
||||
}
|
||||
else
|
||||
onComplete(true);
|
||||
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
@@ -114,7 +110,6 @@ var shopImporter = {
|
||||
onComplete(false);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
syncCurrency : function (onComplete)
|
||||
{
|
||||
@@ -135,7 +130,6 @@ var shopImporter = {
|
||||
}
|
||||
else
|
||||
onComplete(true);
|
||||
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
@@ -149,8 +143,8 @@ var shopImporter = {
|
||||
checkAndSaveConfigWSDL : function (onComplete)
|
||||
{
|
||||
$('#checkAndSaveConfig').fadeOut('slow');
|
||||
$('#steps').html($('#steps').html()+'<div id="database_feedback" style="display:none;" class="conf"><img src="'+shopImporter.srcConf+'">'+wsOk+'</div>');
|
||||
$('#steps').html($('#steps').html()+'<input style="display:none" type="submit" name="next" id="next" class="button" value="'+testImport+'">');
|
||||
$('#steps').html($('#steps').html()+'<div id=\'database_feedback\' style=\'display:none;\' class=\'conf\'><img src=\''+shopImporter.srcConf+'\'>'+wsOk+'</div>');
|
||||
$('#steps').html($('#steps').html()+'<input style=\'display:none\' type=\'submit\' name=\'next\' id=\'next\' class=\'button\' value=\''+testImport+'\'>');
|
||||
$('#next').fadeIn('slow', function () {
|
||||
$('#next').unbind('click').click(function(){
|
||||
$('#next').fadeOut('fast', function() {
|
||||
@@ -165,22 +159,18 @@ var shopImporter = {
|
||||
},
|
||||
checkAndSaveConfigWS : function (save)
|
||||
{
|
||||
|
||||
//sync languages and currency
|
||||
this.syncLangWS(function(isOk) {
|
||||
if (isOk)
|
||||
{
|
||||
shopImporter.syncCurrencyWS(function(isOk) {
|
||||
if (isOk)
|
||||
{
|
||||
|
||||
if ($('#technical_error_feedback').length)
|
||||
$('#technical_error_feedback').fadeIn('slow');
|
||||
|
||||
|
||||
$('#checkAndSaveConfig').fadeOut('slow');
|
||||
$('#steps').html($('#steps').html()+'<div id="database_feedback" style="display:none;" class="conf"><img src="'+shopImporter.srcConf+'">'+databaseOk+'</div>');
|
||||
$('#steps').html($('#steps').html()+'<input style="display:none" type="submit" name="next" id="next" class="button" value="'+testImport+'">');
|
||||
$('#steps').html($('#steps').html()+'<div id=\'database_feedback\' style=\'display:none;\' class=\'conf\'><img src=\''+shopImporter.srcConf+'\'>'+databaseOk+'</div>');
|
||||
$('#steps').html($('#steps').html()+'<input style=\'display:none\' type=\'submit\' name=\'next\' id=\'next\' class=\'button\' value=\''+testImport+'\'>');
|
||||
$('#database_feedback').fadeIn('slow', function() {
|
||||
if (save)
|
||||
{
|
||||
@@ -209,14 +199,9 @@ var shopImporter = {
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
checkAndSaveConfig : function (save)
|
||||
{
|
||||
@@ -225,8 +210,6 @@ var shopImporter = {
|
||||
if (isOk)
|
||||
{
|
||||
shopImporter.syncCurrency(function(isOk) {
|
||||
if (isOk)
|
||||
{
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '../modules/shopimporter/ajax.php',
|
||||
@@ -281,17 +264,13 @@ var shopImporter = {
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
$('#steps').html($('#steps').html()+'<div id="technical_error_feedback" style="display:none;" class="error"><img src="'+shopImporter.srcError+'">TECHNICAL ERROR<br><br>Details: '+XMLHttpRequest.responseText+'</div>');
|
||||
$('#steps').html($('#steps').html()+'<div id=\'technical_error_feedback\' style=\'display:none;\' class=\'error\'><img src="'+shopImporter.srcError+'">TECHNICAL ERROR<br><br>Details: '+XMLHttpRequest.responseText+'</div>');
|
||||
$('#technical_error_feedback').fadeIn('slow');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
getDatasWS : function (methodName)
|
||||
@@ -308,7 +287,7 @@ var shopImporter = {
|
||||
if (typeof(methodName) != 'undefined')
|
||||
{
|
||||
|
||||
$('#steps').html($('#steps').html()+'<div id="ok_feedback_'+methodName[0]+'" style="display:none;" class="import"><img src="'+this.srcImport+'">'+methodName[1]+'<span id="display_error_'+methodName[0]+'" style="display:none"><span><div id="feedback_'+methodName[0]+'_errors_list"></div></div>');
|
||||
$('#steps').html($('#steps').html()+'<div id=\'ok_feedback_'+methodName[0]+'\' style=\'display:none;\' class="import"><img src=\''+this.srcImport+'\'>'+methodName[1]+'<span id=\'display_error_'+methodName[0]+'\' style=\'display:none\'><span><div id=\'feedback_'+methodName[0]+'_errors_list\'></div></div>');
|
||||
$('#ok_feedback_'+methodName[0]).css('display', '');
|
||||
|
||||
$('#checkAndSaveConfig').fadeIn('slow');
|
||||
@@ -318,9 +297,6 @@ var shopImporter = {
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
//data: 'ajax=true&token='+this.token+'&getData&className='+methodName[2]+'&getMethod='+methodName[0]+'&moduleName='+this.moduleName+'&server='+this.server+'&user='+this.user+'&password='+this.password+'&database='+this.database+'&prefix='+prefix+'&limit='+this.limit+'&nbr_import='+this.nbr_import+'&save='+this.save+'&errors='+this.errors+'&hasErrors='+this.hasErrors+this.specificOptions+this.imagesOptions ,
|
||||
|
||||
|
||||
data: 'ajax=true&token='+this.token+'&getDataWS&className='+methodName[2]+'&getMethod='+methodName[0]+'&moduleName='+this.moduleName+'&url='+this.url+'&loginws='+this.loginws+'&apikey='+this.apikey+'&limit='+this.limit+'&nbr_import='+this.nbr_import+'&save='+this.save+'&errors='+this.errors+'&hasErrors='+this.hasErrors+this.specificOptions+this.imagesOptions ,
|
||||
success: function(jsonData)
|
||||
{
|
||||
@@ -404,7 +380,6 @@ var shopImporter = {
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
$('#steps').html($('#steps').html()+'<div id="technical_error_feedback" style="display:none;" class="error"><img src="'+shopImporter.srcError+'">TECHNICAL ERROR<br><br>Details: '+XMLHttpRequest.responseText+'</div>');
|
||||
$('#technical_error_feedback').fadeIn('slow');
|
||||
$('#checkAndSaveConfig').fadeIn('slow');
|
||||
}
|
||||
@@ -562,10 +537,6 @@ var shopImporter = {
|
||||
$('#feedback_'+methodName[0]+'_errors_list > ul').html($('#feedback_'+methodName[0]+'_errors_list > ul').html() + jsonError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
@@ -584,12 +555,11 @@ var shopImporter = {
|
||||
{
|
||||
if (this.save)
|
||||
{
|
||||
$('#steps').html($('#steps').html()+'<div id="ok_feedback_end" style="display:none;" class="conf"><img src="'+shopImporter.srcConf+'">'+importFinish+'</div>');
|
||||
$('#steps').html($('#steps').html()+'<div id=\'ok_feedback_end\' style=\'display:none;\' class=\'conf\'><img src=\''+shopImporter.srcConf+'\'>'+importFinish+'</div>');
|
||||
$('#ok_feedback_end').fadeIn('slow');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#steps').html($('#steps').html()+'<input style="display:none" type="button" name="submitImport" id="submitImport" class="button" value="'+runImport+'">');
|
||||
$('#submitImport').fadeIn('slow', function() {
|
||||
$(this).unbind('click').click(function() {
|
||||
@@ -617,7 +587,6 @@ var shopImporter = {
|
||||
|
||||
};
|
||||
|
||||
|
||||
function enableShowErrors(methodName)
|
||||
{
|
||||
$(document).find('#feedback_'+methodName+'_errors_list').slideToggle();
|
||||
@@ -669,7 +638,7 @@ function initConnexion (moduleName, url, loginws, apikey, token)
|
||||
$('#connectionInformation').removeAttr('style');
|
||||
if (jsonData.hasError)
|
||||
{
|
||||
$('#connectionInformation').attr("style","width: 400px;background-color: #FAE2E3;border: 1px solid #EC9B9B");
|
||||
$('#connectionInformation').attr('style','width: 400px;background-color: #FAE2E3;border: 1px solid #EC9B9B');
|
||||
for (i=0;i<jsonData.error.length;i++)
|
||||
jsonError = jsonError+'<li>'+jsonData.error[i]+'</li>';
|
||||
$('#connectionInformation').slideDown('slow');
|
||||
@@ -678,7 +647,7 @@ function initConnexion (moduleName, url, loginws, apikey, token)
|
||||
}else
|
||||
{
|
||||
|
||||
$('#connectionInformation').attr("style","width: 400px;background-color: #DFFAD3;border: 1px solid #72CB67");
|
||||
$('#connectionInformation').attr('style','width: 400px;background-color: #DFFAD3;border: 1px solid #72CB67');
|
||||
$('#connectionInformation').slideDown('slow');
|
||||
$('#connectionInformation').html('<ul>Connection successful</ul>');
|
||||
$('#connectionInformation').show();
|
||||
@@ -689,7 +658,6 @@ function initConnexion (moduleName, url, loginws, apikey, token)
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
alert('TECHNICAL ERROR\nDetails:\nError thrown: ' + XMLHttpRequest + '\n' + 'Text status: ' + textStatus);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -702,7 +670,7 @@ function displaySpecificOptionsWsdl(moduleName,token)
|
||||
url: '../modules/shopimporter/ajax.php',
|
||||
async: false,
|
||||
cache: false,
|
||||
dataType : "html",
|
||||
dataType : 'html',
|
||||
data: 'ajax=true&token='+token+'&displaySpecificOptionsWsdl&moduleName='+moduleName ,
|
||||
success: function(htmlData)
|
||||
{
|
||||
@@ -724,7 +692,7 @@ function validateSpecificOptions(moduleName, specificOptions)
|
||||
url: '../modules/shopimporter/ajax.php',
|
||||
async: false,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
dataType : 'json',
|
||||
data: 'ajax=true&token='+this.token+'&validateSpecificOptions&moduleName='+moduleName+specificOptions ,
|
||||
success: function(jsonData)
|
||||
{
|
||||
@@ -766,7 +734,7 @@ function initConfigConnector()
|
||||
url: '../modules/shopimporter/ajax.php',
|
||||
async: false,
|
||||
cache: false,
|
||||
dataType : "html",
|
||||
dataType : 'html',
|
||||
|
||||
data: 'ajax=true&token='+globalAjaxShopImporterToken+'&displayConfigConnector&moduleName='+$('#import_module_name').val() ,
|
||||
success: function(html)
|
||||
@@ -800,9 +768,6 @@ $(document).ready(function(){
|
||||
$(this).html('');
|
||||
$('#steps').fadeIn();
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#importOptions').fadeOut('slow');
|
||||
$('#displayOptions').show();
|
||||
$('#checkAndSaveConfig').show();
|
||||
@@ -832,8 +797,6 @@ $(document).ready(function(){
|
||||
return false;
|
||||
}else{
|
||||
$('#connectionInformation').hide();
|
||||
|
||||
|
||||
}
|
||||
token = globalAjaxShopImporterToken;
|
||||
initConnexion($('#import_module_name').val(), $('#url').val(), $('#loginws').val(), $('#apikey').val(), token);
|
||||
@@ -873,7 +836,7 @@ $(document).ready(function(){
|
||||
{
|
||||
if($('#import_module_name').attr('value') == 'importermagento')
|
||||
{
|
||||
$.scrollTo($("#steps"), 300 , {
|
||||
$.scrollTo($('#steps'), 300 , {
|
||||
onAfter:function(){
|
||||
shopImporter.specificOptions = '';
|
||||
$('#specificOptionsContent :input').each(function (){
|
||||
@@ -899,7 +862,7 @@ $(document).ready(function(){
|
||||
});
|
||||
}else if ($('#import_module_name').attr('value') == 'importerosc')
|
||||
{
|
||||
$.scrollTo($("#steps"), 300 , {
|
||||
$.scrollTo($('#steps'), 300 , {
|
||||
onAfter:function(){
|
||||
shopImporter.specificOptions = '';
|
||||
$('#specificOptionsContent :input').each(function (){
|
||||
@@ -923,7 +886,6 @@ $(document).ready(function(){
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#importOptionsYesNo :radio').change( function () {
|
||||
@@ -939,7 +901,7 @@ $(document).ready(function(){
|
||||
else
|
||||
{
|
||||
$('#checkAndSaveConfig').fadeOut();
|
||||
$('#steps').html('<div id="one_thing_error_feedback" style="display:none;" class="error"><img src="'+shopImporter.srcError+'">'+oneThing+'</div>');
|
||||
$('#steps').html('<div id=\'one_thing_error_feedback\' style=\'display:none;\' class=\'error\'><img src=\''+shopImporter.srcError+'\'>'+oneThing+'</div>');
|
||||
$('#one_thing_error_feedback').fadeIn('slow');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -289,7 +289,7 @@ class shopimporter extends ImportModule
|
||||
$exportModules = parent::getImportModulesOnDisk();
|
||||
//get installed module only
|
||||
foreach($exportModules as $key => $module)
|
||||
if ($module->name == $this->name OR !(bool)$module->id)
|
||||
if ($module->name == $this->name || !(bool)$module->id)
|
||||
unset($exportModules[$key]);
|
||||
$html = '<script type="text/javascript">var globalAjaxShopImporterToken = "'.sha1(_COOKIE_KEY_.'ajaxShopImporter').'";</script>
|
||||
<script type="text/javascript" src="../modules/shopimporter/shopimporter.js"></script>
|
||||
@@ -418,7 +418,7 @@ class shopimporter extends ImportModule
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function generiqueImport($className, $fields, $save = false)
|
||||
public function genericImport($className, $fields, $save = false)
|
||||
{
|
||||
$return = '';
|
||||
$json = array();
|
||||
@@ -432,7 +432,7 @@ class shopimporter extends ImportModule
|
||||
$object = new $className();
|
||||
$rules = call_user_func(array($className, 'getValidationRules'), $className);
|
||||
|
||||
if ((sizeof($rules['requiredLang']) OR sizeof($rules['sizeLang']) OR sizeof($rules['validateLang']) OR Tools::isSubmit('syncLang') OR Tools::isSubmit('syncCurrency')))
|
||||
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLang') || Tools::isSubmit('syncCurrency')))
|
||||
{
|
||||
$moduleName = Tools::getValue('moduleName');
|
||||
if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
|
||||
@@ -446,7 +446,7 @@ class shopimporter extends ImportModule
|
||||
$importModule->prefix = Tools::getValue('prefix');
|
||||
$defaultLanguage = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
$languages = $importModule->getLangagues(0);
|
||||
if (Tools::isSubmit('syncLang') OR Tools::isSubmit('syncLangWS'))
|
||||
if (Tools::isSubmit('syncLang') || Tools::isSubmit('syncLangWS'))
|
||||
{
|
||||
$defaultIdLand = $importModule->getDefaultIdLang();
|
||||
$defaultLanguageImport = new Language(Language::getIdByIso($languages[$defaultIdLand]['iso_code']));
|
||||
@@ -455,7 +455,7 @@ class shopimporter extends ImportModule
|
||||
'.$importModule->displayName.' : '.$defaultLanguageImport->name.'<br>'.$this->l('Please change default language in your configuration');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('syncCurrency') OR Tools::isSubmit('syncCurrencyWS'))
|
||||
if (Tools::isSubmit('syncCurrency') || Tools::isSubmit('syncCurrencyWS'))
|
||||
{
|
||||
$defaultIdCurrency = $importModule->getDefaultIdCurrency();
|
||||
$currencies = $importModule->getCurrencies(0);
|
||||
@@ -499,15 +499,13 @@ class shopimporter extends ImportModule
|
||||
$json['hasError'] = true;
|
||||
$json['error'] = $errors;
|
||||
}
|
||||
//die('');
|
||||
if ($save OR Tools::isSubmit('syncLang') OR Tools::isSubmit('syncLangWS'))
|
||||
{
|
||||
|
||||
if ($save || Tools::isSubmit('syncLang') || Tools::isSubmit('syncLangWS'))
|
||||
{
|
||||
//add language if not exist in prestashop
|
||||
if ($className == 'Language')
|
||||
{
|
||||
|
||||
if (Tools::isSubmit('syncLang') OR Tools::isSubmit('syncLangWS'))
|
||||
if (Tools::isSubmit('syncLang') || Tools::isSubmit('syncLangWS'))
|
||||
$add = true;
|
||||
else
|
||||
$add = false;
|
||||
@@ -540,7 +538,7 @@ class shopimporter extends ImportModule
|
||||
}
|
||||
die(Tools::jsonEncode($json));
|
||||
}
|
||||
public function generiqueImportWS($className, $fields, $save = false)
|
||||
public function genericImportWS($className, $fields, $save = false)
|
||||
{
|
||||
|
||||
$return = '';
|
||||
@@ -557,7 +555,7 @@ class shopimporter extends ImportModule
|
||||
$rules = call_user_func(array($className, 'getValidationRules'), $className);
|
||||
|
||||
|
||||
if ((sizeof($rules['requiredLang']) OR sizeof($rules['sizeLang']) OR sizeof($rules['validateLang']) OR Tools::isSubmit('syncLangWS') OR Tools::isSubmit('syncCurrency')))
|
||||
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLangWS') || Tools::isSubmit('syncCurrency')))
|
||||
{
|
||||
$moduleName = Tools::getValue('moduleName');
|
||||
if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
|
||||
@@ -565,12 +563,6 @@ class shopimporter extends ImportModule
|
||||
|
||||
require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php');
|
||||
$importModule = new $moduleName();
|
||||
/* $importModule->server = Tools::getValue('server');
|
||||
$importModule->user = Tools::getValue('user');
|
||||
$importModule->passwd = Tools::getValue('password');
|
||||
$importModule->database = Tools::getValue('database');
|
||||
$importModule->prefix = Tools::getValue('prefix');
|
||||
*/
|
||||
|
||||
$defaultLanguage = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
|
||||
@@ -629,12 +621,12 @@ class shopimporter extends ImportModule
|
||||
$json['hasError'] = true;
|
||||
$json['error'] = $errors;
|
||||
}
|
||||
if ($save OR Tools::isSubmit('syncLang') OR Tools::isSubmit('syncLangWS'))
|
||||
if ($save || Tools::isSubmit('syncLang') || Tools::isSubmit('syncLangWS'))
|
||||
{
|
||||
//add language if not exist in prestashop
|
||||
if ($className == 'Language')
|
||||
{
|
||||
if (Tools::isSubmit('syncLang') OR Tools::isSubmit('syncLangWS'))
|
||||
if (Tools::isSubmit('syncLang') || Tools::isSubmit('syncLangWS'))
|
||||
$add = true;
|
||||
else
|
||||
$add = false;
|
||||
@@ -938,7 +930,7 @@ class shopimporter extends ImportModule
|
||||
foreach ($this->supportedImports[$className]['alterTable'] AS $name => $type)
|
||||
{
|
||||
$moduleName = Tools::getValue('moduleName');
|
||||
Db::getInstance()->ExecuteS("SHOW COLUMNS FROM `"._DB_PREFIX_.pSQL($from)."` LIKE '".$name.'_'.$moduleName."'");
|
||||
Db::getInstance()->ExecuteS("SHOW COLUMNS FROM `"._DB_PREFIX_.pSQL($from)."` LIKE '".pSQL($name).'_'.pSQL($moduleName)."'");
|
||||
if (!Db::getInstance()->numRows() AND !array_key_exists($name.'_'.$moduleName, $result))
|
||||
$queryTmp .= ' ADD `'.$name.'_'.$moduleName.'` '.$type.' NOT NULL,';
|
||||
}
|
||||
@@ -1065,13 +1057,13 @@ class shopimporter extends ImportModule
|
||||
else
|
||||
$returnErrors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is invalid');
|
||||
|
||||
if ((sizeof($rules['requiredLang']) OR sizeof($rules['sizeLang']) OR sizeof($rules['validateLang'])))
|
||||
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang'])))
|
||||
{
|
||||
$matchIdLang = $this->getMatchIdLang(0);
|
||||
/* Checking for multilingual required fields */
|
||||
foreach ($rules['requiredLang'] AS $fieldLang)
|
||||
{
|
||||
if (($empty = $fields[$fieldLang][$matchIdLang[$defaultLanguage->id]]) === false OR empty($empty))
|
||||
if (($empty = $fields[$fieldLang][$matchIdLang[$defaultLanguage->id]]) === false || empty($empty))
|
||||
if ($hasErrors == 2)
|
||||
{
|
||||
if (array_key_exists($fieldLang, $rules['sizeLang']))
|
||||
|
||||
@@ -684,7 +684,7 @@ class Socolissimo extends CarrierModule
|
||||
{
|
||||
if (Configuration::get('SOCOLISSIMO_SUP'))
|
||||
{
|
||||
$ctx = stream_context_create(array('http' => array('timeout' => 1)));
|
||||
$ctx = @stream_context_create(array('http' => array('timeout' => 1)));
|
||||
$return = @file_get_contents(Configuration::get('SOCOLISSIMO_SUP_URL'), 0, $ctx);
|
||||
|
||||
if(ini_get('allow_url_fopen') == 0)
|
||||
|
||||
@@ -130,6 +130,7 @@ $_MODULE['<{trustedshops}prestashop>tsbuyerprotection_23a58bf9274bedb19375e527a0
|
||||
$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd5291d7f0624933870702ff183bb14e'] = 'module de paiement';
|
||||
$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b3b1a406e097bc87c8745db26e11904e'] = 'Le mettre à jour';
|
||||
$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c9ba5f6e6d58162530424afaa68bf496'] = 'Configuration de la tâche cron';
|
||||
$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_12a4fc31ae8a9e4038df56961a5aec9b'] = 'Si vous utilisez un certificat Trusted Shops EXCELLENCE dans votre magasin, mis en place d\'une tâche cron sur votre serveur web.';
|
||||
$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f811271eb84f3df1a430c3c78b6e7640'] = 'Lancez le fichier';
|
||||
$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_06ec9154ce96a389f7b1d884e021818b'] = 'avec un intervalle de 10 minutes.';
|
||||
$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f89b7100efcc136900c909690e43f008'] = 'La ligne correspondante dans votre fichier cron apparaît ainsi :';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>upscarrier</name>
|
||||
<displayName><![CDATA[UPS Carrier]]></displayName>
|
||||
<version><![CDATA[1.2]]></version>
|
||||
<version><![CDATA[1.2.1]]></version>
|
||||
<description><![CDATA[Offer your customers, different delivery methods with UPS]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[shipping_logistics]]></tab>
|
||||
|
||||
@@ -55,7 +55,7 @@ class UpsCarrier extends CarrierModule
|
||||
{
|
||||
$this->name = 'upscarrier';
|
||||
$this->tab = 'shipping_logistics';
|
||||
$this->version = '1.2';
|
||||
$this->version = '1.2.1';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->limited_countries = array('us');
|
||||
|
||||
@@ -1798,6 +1798,7 @@ class UpsCarrier extends CarrierModule
|
||||
|
||||
foreach ($wsParams['package_list'] as $p)
|
||||
{
|
||||
if ($p['weight'] < 0.5) $p['weight'] = 0.5;
|
||||
$search = array('[[PackagingTypeCode]]', '[[PackageWeight]]', '[[WeightUnit]]', '[[Width]]', '[[Height]]', '[[Length]]', '[[DimensionUnit]]');
|
||||
$replace = array($p['packaging_type'], $p['weight'], $this->_weightUnit, $p['width'], $p['height'], $p['depth'], $this->_dimensionUnit);
|
||||
$xmlPackageList .= str_replace($search, $replace, $xmlPackageTemplate);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_ec6bd501021318b872a9eddd897a9cc2'] = 'Calcul des frais U.S.P.S';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_098087ab799def1028233142cafeeafd'] = 'Propose à vos clients le transporteur USPS (US Postal)';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_883fa0069f4b0454e2277dd567ab3991'] = '\'Unité de poids (LB ou KG)\'';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_5a3ceec65d417f5d92c26dbf0dccc00d'] = '\'Unité de mesure (CM ou IN)\'';
|
||||
@@ -69,6 +70,8 @@ $_MODULE['<{uspscarrier}prestashop>uspscarrier_8d2ee0603dfce09b57d60db628cde269'
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_795de10b1bdcb843b3703c63ad577fc6'] = 'Choisissez le type de paquet par défaut';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_93c8645dbbc33cf8d126266a827a5501'] = 'Machinable';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_67cd0f5256c40c16a6cfd6effe3ab06b'] = 'Choisissez si cela peut être traité par une machine ou non par défaut';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_f297d2cb126758a96ae196f1865f74ec'] = 'Mode de calcul';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_fc805e1616e45e041e8bef86a9e3180d'] = 'Utiliser le mode de calcul \"Tous les éléments dans un seul paquet\" utilisera automatiquement la taille des emballages par défaut, le type d\'emballage et de livraison. Les configurations spécifiques pour les catégories ou de produit ne seront pas utilisés.';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_5cdd307ba6e260beb4801c0c10e22a3a'] = 'Service de livraison';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_78945de8de090e90045d299651a68a9b'] = 'Disponible';
|
||||
$_MODULE['<{uspscarrier}prestashop>uspscarrier_2d25c72c1b18e562f6654fff8e11711e'] = 'Non disponible';
|
||||
|
||||
@@ -142,7 +142,6 @@ $(function(){ldelim}
|
||||
{foreach from=$ordered_adr_fields item=field_name}
|
||||
{if $field_name eq 'company'}
|
||||
<p class="text">
|
||||
<input type="hidden" name="token" value="{$token}" />
|
||||
<label for="company">{l s='Company'}</label>
|
||||
<input type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{if isset($address->company)}{$address->company|escape:'htmlall':'UTF-8'}{/if}{/if}" />
|
||||
</p>
|
||||
@@ -187,10 +186,7 @@ $(function(){ldelim}
|
||||
<input type="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{else}{if isset($address->city)}{$address->city|escape:'htmlall':'UTF-8'}{/if}{/if}" maxlength="64" />
|
||||
<sup>*</sup>
|
||||
</p>
|
||||
<!--
|
||||
if customer hasn't update his layout address, country has to be verified
|
||||
but it's deprecated
|
||||
-->
|
||||
<!-- If the merchant has not updated his layout address, country has to be verified - however it's deprecated -->
|
||||
{/if}
|
||||
{if $field_name eq 'Country:name' || $field_name eq 'country'}
|
||||
<p class="required select">
|
||||
@@ -237,6 +233,7 @@ $(function(){ldelim}
|
||||
</p>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<p><input type="hidden" name="token" value="{$token}" /></p>
|
||||
{if $stateExist eq "false"}
|
||||
<p class="required id_state select">
|
||||
<label for="id_state">{l s='State'}</label>
|
||||
|
||||
@@ -1175,6 +1175,9 @@ tr.cart_total_price { font-weight: bold }
|
||||
margin: 1em 0
|
||||
}
|
||||
|
||||
#guest-tracking p.center { width: 100%; text-align: center; }
|
||||
#guest-tracking p.center input.exclusive_large { display: inline; }
|
||||
|
||||
/* views block */
|
||||
#views_block {
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -24,10 +24,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{capture name=path}{l s='Guest tracking'}{/capture}
|
||||
{capture name=path}{l s='Guests: Track your order'}{/capture}
|
||||
{include file="$tpl_dir./breadcrumb.tpl"}
|
||||
|
||||
<h1>{l s='Guest Tracking'}</h1>
|
||||
<h1>{l s='Guests: Track your order'}</h1>
|
||||
|
||||
{if isset($order)}
|
||||
<div id="block-history">
|
||||
@@ -35,36 +35,39 @@
|
||||
{include file="$tpl_dir./order-detail.tpl"}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 id="guestToCustomer">{l s='For more advantages...'}</h2>
|
||||
|
||||
|
||||
<h2 id="guestToCustomer">{l s='Create your customer account'}</h2>
|
||||
|
||||
{include file="$tpl_dir./errors.tpl"}
|
||||
|
||||
|
||||
{if isset($transformSuccess)}
|
||||
<p class="success">{l s='Your guest account has been successfully transformed into a customer account. You can now log in on this'} <a href="{$link->getPageLink('authentication', true)}">{l s='page'}</a></p>
|
||||
{else}
|
||||
<form method="post" action="{$action|escape:'htmlall':'UTF-8'}#guestToCustomer" class="std">
|
||||
<fieldset>
|
||||
<p class="bold">{l s='Transform your guest account to a customer account and enjoy :'}</p>
|
||||
<p class="bold">{l s='Transform your guest account into a customer account and enjoy:'}</p>
|
||||
<ul class="bullet">
|
||||
<li>{l s='Personalized and secure access'}</li>
|
||||
<li>{l s='Fast and easy check out'}</li>
|
||||
<li>{l s='Personal and secure access'}</li>
|
||||
<li>{l s='Quick and easy check out'}</li>
|
||||
<li>{l s='Easier merchandise return'}</li>
|
||||
</ul>
|
||||
<p class="text">
|
||||
<label>{l s='Define your password:'}</label>
|
||||
<input type="password" name="password" />
|
||||
</p>
|
||||
|
||||
|
||||
<input type="hidden" name="id_order" value="{if isset($smarty.get.id_order)}{$smarty.get.id_order|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.id_order)}{$smarty.post.id_order|escape:'htmlall':'UTF-8'}{/if}{/if}" />
|
||||
<input type="hidden" name="email" value="{if isset($smarty.get.email)}{$smarty.get.email|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.email)}{$smarty.post.email|escape:'htmlall':'UTF-8'}{/if}{/if}" />
|
||||
|
||||
<p class="center"><input type="submit" class="exclusive_large" name="submitTransformGuestToCustomer" value="{l s='Send'}" /></p>
|
||||
|
||||
<p class="center"><input type="submit" class="exclusive_large" name="submitTransformGuestToCustomer" value="{l s='Submit'}" /></p>
|
||||
</fieldset>
|
||||
</form>
|
||||
{/if}
|
||||
{else}
|
||||
{include file="$tpl_dir./errors.tpl"}
|
||||
{if isset($show_login_link) && $show_login_link}
|
||||
<p><img src="{$img_dir}icon/userinfo.gif" alt="{l s='Information'}" class="icon" /><a href="{$link->getPageLink('my-account.php', true)}">{l s='Click here to log-in to your customer account'}</a><br /><br /></p>
|
||||
{/if}
|
||||
<form method="post" action="{$action|escape:'htmlall':'UTF-8'}" class="std">
|
||||
<fieldset>
|
||||
<p>{l s='To track your order, please enter the following information:'}</p>
|
||||
@@ -73,13 +76,13 @@
|
||||
<input type="text" name="id_order" value="{if isset($smarty.get.id_order)}{$smarty.get.id_order|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.id_order)}{$smarty.post.id_order|escape:'htmlall':'UTF-8'}{/if}{/if}" size="8" />
|
||||
<i>{l s='For example: 010123'}</i>
|
||||
</p>
|
||||
|
||||
|
||||
<p class="text">
|
||||
<label>{l s='E-mail:'}</label>
|
||||
<input type="text" name="email" value="{if isset($smarty.get.email)}{$smarty.get.email|escape:'htmlall':'UTF-8'}{else}{if isset($smarty.post.email)}{$smarty.post.email|escape:'htmlall':'UTF-8'}{/if}{/if}" />
|
||||
</p>
|
||||
|
||||
<p class="center"><input type="submit" class="button" name="submitGuestTracking" value="{l s='Send'}" /></p>
|
||||
|
||||
<p class="center"><input type="submit" class="exclusive_large" name="submitGuestTracking" value="{l s='View my order'}" /></p>
|
||||
</fieldset>
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
@@ -263,9 +263,9 @@
|
||||
</div>
|
||||
{elseif $field_name eq "state" || $field_name eq 'State:name'}
|
||||
{$stateExist = true}
|
||||
<p class="required id_state_invoice select" style="display:none;">
|
||||
<label for="id_state_invoice">{l s='State'}</label>
|
||||
<select name="id_state_invoice" id="id_state_invoice">
|
||||
<p class="required id_state select" style="display:none;">
|
||||
<label for="id_state">{l s='State'}</label>
|
||||
<select name="id_state" id="id_state">
|
||||
<option value="">-</option>
|
||||
</select>
|
||||
<sup>*</sup>
|
||||
|
||||
@@ -24,9 +24,19 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{if isset($no_follow) AND $no_follow}
|
||||
{assign var='no_follow_text' value='rel="nofollow"'}
|
||||
{else}
|
||||
{assign var='no_follow_text' value=''}
|
||||
{/if}
|
||||
|
||||
{if isset($p) AND $p}
|
||||
{if isset($smarty.get.id_category) && $smarty.get.id_category && isset($category)}
|
||||
{if !isset($current_url)}
|
||||
{assign var='requestPage' value=$link->getPaginationLink('category', $category, false, false, true, false)}
|
||||
{else}
|
||||
{assign var='requestPage' value=$current_url}
|
||||
{/if}
|
||||
{assign var='requestNb' value=$link->getPaginationLink('category', $category, true, false, false, true)}
|
||||
{elseif isset($smarty.get.id_manufacturer) && $smarty.get.id_manufacturer && isset($manufacturer)}
|
||||
{assign var='requestPage' value=$link->getPaginationLink('manufacturer', $manufacturer, false, false, true, false)}
|
||||
@@ -44,19 +54,19 @@
|
||||
<ul class="pagination">
|
||||
{if $p != 1}
|
||||
{assign var='p_previous' value=$p-1}
|
||||
<li id="pagination_previous"><a href="{$link->goPage($requestPage, $p_previous)}">« {l s='Previous'}</a></li>
|
||||
<li id="pagination_previous"><a {$no_follow_text} href="{$link->goPage($requestPage, $p_previous)}">« {l s='Previous'}</a></li>
|
||||
{else}
|
||||
<li id="pagination_previous" class="disabled"><span>« {l s='Previous'}</span></li>
|
||||
{/if}
|
||||
{if $start>3}
|
||||
<li><a href="{$link->goPage($requestPage, 1)}">1</a></li>
|
||||
<li><a {$no_follow_text} href="{$link->goPage($requestPage, 1)}">1</a></li>
|
||||
<li class="truncate">...</li>
|
||||
{/if}
|
||||
{section name=pagination start=$start loop=$stop+1 step=1}
|
||||
{if $p == $smarty.section.pagination.index}
|
||||
<li class="current"><span>{$p|escape:'htmlall':'UTF-8'}</span></li>
|
||||
{else}
|
||||
<li><a href="{$link->goPage($requestPage, $smarty.section.pagination.index)}">{$smarty.section.pagination.index|escape:'htmlall':'UTF-8'}</a></li>
|
||||
<li><a {$no_follow_text} href="{$link->goPage($requestPage, $smarty.section.pagination.index)}">{$smarty.section.pagination.index|escape:'htmlall':'UTF-8'}</a></li>
|
||||
{/if}
|
||||
{/section}
|
||||
{if $pages_nb>$stop+2}
|
||||
@@ -65,7 +75,7 @@
|
||||
{/if}
|
||||
{if $pages_nb > 1 AND $p != $pages_nb}
|
||||
{assign var='p_next' value=$p+1}
|
||||
<li id="pagination_next"><a href="{$link->goPage($requestPage, $p_next)}">{l s='Next'} »</a></li>
|
||||
<li id="pagination_next"><a {$no_follow_text} href="{$link->goPage($requestPage, $p_next)}">{l s='Next'} »</a></li>
|
||||
{else}
|
||||
<li id="pagination_next" class="disabled"><span>{l s='Next'} »</span></li>
|
||||
{/if}
|
||||
|
||||
@@ -39,7 +39,7 @@ require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/Exception.php');
|
||||
* to the entire feed.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser implements Iterator
|
||||
@@ -87,13 +87,13 @@ class XML_Feed_Parser implements Iterator
|
||||
function __construct($feed, $strict = false, $suppressWarnings = false, $tidy = false)
|
||||
{
|
||||
$this->model = new DOMDocument;
|
||||
if (! $this->model->loadXML($feed)) {
|
||||
if (! @$this->model->loadXML($feed)) { /* PrestaShop - no error display */
|
||||
if (extension_loaded('tidy') && $tidy) {
|
||||
$tidy = new tidy;
|
||||
$tidy->parseString($feed,
|
||||
array('input-xml' => true, 'output-xml' => true));
|
||||
$tidy->cleanRepair();
|
||||
if (! $this->model->loadXML((string) $tidy)) {
|
||||
if (! @$this->model->loadXML((string) $tidy)) { /* PrestaShop - no error display */
|
||||
throw new XML_Feed_Parser_Exception('Invalid input: this is not ' .
|
||||
'valid XML');
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
* person - defaults to name, but parameter based access
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type
|
||||
@@ -39,7 +39,7 @@ class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type
|
||||
* The URI of the RelaxNG schema used to (optionally) validate the feed
|
||||
* @var string
|
||||
*/
|
||||
private $relax = 'atom.rnc';
|
||||
protected $relax = 'atom.rng';
|
||||
|
||||
/**
|
||||
* We're likely to use XPath, so let's keep it global
|
||||
@@ -117,7 +117,7 @@ class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type
|
||||
$this->model = $model;
|
||||
|
||||
if ($strict) {
|
||||
if (! $this->model->relaxNGValidateSource($this->relax)) {
|
||||
if (! $this->relaxNGValidate()) {
|
||||
throw new XML_Feed_Parser_Exception('Failed required validation');
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type
|
||||
|
||||
if ($entries->length > 0) {
|
||||
$xmlBase = $entries->item(0)->baseURI;
|
||||
$entry = new $this->itemElement($entries->item(0), $this, $xmlBase);
|
||||
$entry = new $this->itemClass($entries->item(0), $this, $xmlBase);
|
||||
|
||||
if (in_array('evaluate', get_class_methods($this->xpath))) {
|
||||
$offset = $this->xpath->evaluate("count(preceding-sibling::atom:entry)", $entries->item(0));
|
||||
@@ -232,6 +232,7 @@ class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->parseTextConstruct($content);
|
||||
}
|
||||
|
||||
@@ -258,12 +259,11 @@ class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type
|
||||
if (strpos($type, 'text/') === 0) {
|
||||
$type = 'text';
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'text':
|
||||
return $content->nodeValue;
|
||||
break;
|
||||
case 'html':
|
||||
return str_replace('<', '<', $content->nodeValue);
|
||||
return $content->textContent;
|
||||
break;
|
||||
case 'xhtml':
|
||||
$container = $content->getElementsByTagName('div');
|
||||
@@ -277,7 +277,7 @@ class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type
|
||||
foreach ($contents->childNodes as $node) {
|
||||
$result .= $this->traverseNode($node);
|
||||
}
|
||||
return utf8_decode($result);
|
||||
return $result;
|
||||
}
|
||||
break;
|
||||
case preg_match('@^[a-zA-Z]+/[a-zA-Z+]*xml@i', $type) > 0:
|
||||
@@ -362,4 +362,4 @@ class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* XML_Feed_Parser_Atom with which it shares many methods.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser_AtomElement extends XML_Feed_Parser_Atom
|
||||
|
||||
@@ -31,7 +31,7 @@ require_once(dirname(__FILE__).'/../../pear/PEAR.php');
|
||||
* to help with identification of the source of exceptions.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser_Exception extends PEAR_Exception
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* This class handles RSS0.9 feeds.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
* @todo Find a Relax NG URI we can use
|
||||
*/
|
||||
@@ -35,7 +35,7 @@ class XML_Feed_Parser_RSS09 extends XML_Feed_Parser_Type
|
||||
* The URI of the RelaxNG schema used to (optionally) validate the feed
|
||||
* @var string
|
||||
*/
|
||||
private $relax = '';
|
||||
protected $relax = '';
|
||||
|
||||
/**
|
||||
* We're likely to use XPath, so let's keep it global
|
||||
@@ -209,6 +209,13 @@ class XML_Feed_Parser_RSS09 extends XML_Feed_Parser_Type
|
||||
$link = $links->item($offset);
|
||||
return $this->addBase($link->nodeValue, $link);
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented - no available validation.
|
||||
*/
|
||||
public function relaxNGValidate() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* XML_Feed_Parser_RSS09 with which it shares many methods.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser_RSS09Element extends XML_Feed_Parser_RSS09
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* This class handles RSS1.0 feeds.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
* @todo Find a Relax NG URI we can use
|
||||
*/
|
||||
@@ -35,7 +35,7 @@ class XML_Feed_Parser_RSS1 extends XML_Feed_Parser_Type
|
||||
* The URI of the RelaxNG schema used to (optionally) validate the feed
|
||||
* @var string
|
||||
*/
|
||||
private $relax = 'rss10.rnc';
|
||||
protected $relax = 'rss10.rng';
|
||||
|
||||
/**
|
||||
* We're likely to use XPath, so let's keep it global
|
||||
@@ -121,9 +121,7 @@ class XML_Feed_Parser_RSS1 extends XML_Feed_Parser_Type
|
||||
{
|
||||
$this->model = $model;
|
||||
if ($strict) {
|
||||
$validate = $this->model->relaxNGValidate(self::getSchemaDir .
|
||||
DIRECTORY_SEPARATOR . $this->relax);
|
||||
if (! $validate) {
|
||||
if (! $this->relaxNGValidate()) {
|
||||
throw new XML_Feed_Parser_Exception('Failed required validation');
|
||||
}
|
||||
}
|
||||
@@ -274,4 +272,4 @@ class XML_Feed_Parser_RSS1 extends XML_Feed_Parser_Type
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* http://inamidst.com/rss1.1/
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
* @todo Support for RDF:List
|
||||
* @todo Ensure xml:lang is accessible to users
|
||||
@@ -37,7 +37,7 @@ class XML_Feed_Parser_RSS11 extends XML_Feed_Parser_Type
|
||||
* The URI of the RelaxNG schema used to (optionally) validate the feed
|
||||
* @var string
|
||||
*/
|
||||
private $relax = 'rss11.rnc';
|
||||
protected $relax = 'rss11.rng';
|
||||
|
||||
/**
|
||||
* We're likely to use XPath, so let's keep it global
|
||||
@@ -123,9 +123,7 @@ class XML_Feed_Parser_RSS11 extends XML_Feed_Parser_Type
|
||||
$this->model = $model;
|
||||
|
||||
if ($strict) {
|
||||
$validate = $this->model->relaxNGValidate(self::getSchemaDir .
|
||||
DIRECTORY_SEPARATOR . $this->relax);
|
||||
if (! $validate) {
|
||||
if (! $this->relaxNGValidate()) {
|
||||
throw new XML_Feed_Parser_Exception('Failed required validation');
|
||||
}
|
||||
}
|
||||
@@ -273,4 +271,4 @@ class XML_Feed_Parser_RSS11 extends XML_Feed_Parser_Type
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* XML_Feed_Parser_RSS11 with which it shares many methods.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser_RSS11Element extends XML_Feed_Parser_RSS11
|
||||
@@ -65,7 +65,7 @@ class XML_Feed_Parser_RSS11Element extends XML_Feed_Parser_RSS11
|
||||
protected $compatMap = array(
|
||||
'content' => array('content'),
|
||||
'updated' => array('lastBuildDate'),
|
||||
'published' => array('pubdate'),
|
||||
'published' => array('date'),
|
||||
'subtitle' => array('description'),
|
||||
'updated' => array('date'),
|
||||
'author' => array('creator'),
|
||||
@@ -148,4 +148,4 @@ class XML_Feed_Parser_RSS11Element extends XML_Feed_Parser_RSS11
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* XML_Feed_Parser_RSS1 with which it shares many methods.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser_RSS1Element extends XML_Feed_Parser_RSS1
|
||||
@@ -65,7 +65,7 @@ class XML_Feed_Parser_RSS1Element extends XML_Feed_Parser_RSS1
|
||||
protected $compatMap = array(
|
||||
'content' => array('content'),
|
||||
'updated' => array('lastBuildDate'),
|
||||
'published' => array('pubdate'),
|
||||
'published' => array('date'),
|
||||
'subtitle' => array('description'),
|
||||
'updated' => array('date'),
|
||||
'author' => array('creator'),
|
||||
@@ -113,4 +113,4 @@ class XML_Feed_Parser_RSS1Element extends XML_Feed_Parser_RSS1
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* This class handles RSS2 feeds.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser_RSS2 extends XML_Feed_Parser_Type
|
||||
@@ -34,7 +34,7 @@ class XML_Feed_Parser_RSS2 extends XML_Feed_Parser_Type
|
||||
* The URI of the RelaxNG schema used to (optionally) validate the feed
|
||||
* @var string
|
||||
*/
|
||||
private $relax = 'rss20.rnc';
|
||||
protected $relax = 'rss20.rng';
|
||||
|
||||
/**
|
||||
* We're likely to use XPath, so let's keep it global
|
||||
@@ -116,7 +116,7 @@ class XML_Feed_Parser_RSS2 extends XML_Feed_Parser_Type
|
||||
$this->model = $model;
|
||||
|
||||
if ($strict) {
|
||||
if (! $this->model->relaxNGValidate($this->relax)) {
|
||||
if (! $this->relaxNGValidate()) {
|
||||
throw new XML_Feed_Parser_Exception('Failed required validation');
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ class XML_Feed_Parser_RSS2 extends XML_Feed_Parser_Type
|
||||
*/
|
||||
protected function getImage()
|
||||
{
|
||||
$images = $this->model->getElementsByTagName('image');
|
||||
$images = $this->xpath->query("//image");
|
||||
if ($images->length > 0) {
|
||||
$image = $images->item(0);
|
||||
$desc = $image->getElementsByTagName('description');
|
||||
@@ -331,4 +331,4 @@ class XML_Feed_Parser_RSS2 extends XML_Feed_Parser_Type
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* called by XML_Feed_Parser_RSS2 with which it shares many methods.
|
||||
*
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
* @package XML_Feed_Parser
|
||||
*/
|
||||
class XML_Feed_Parser_RSS2Element extends XML_Feed_Parser_RSS2
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
*
|
||||
* @package XML_Feed_Parser
|
||||
* @author James Stewart <james@jystewart.net>
|
||||
* @version Release: 1.0.2
|
||||
* @version Release: @package_version@
|
||||
*/
|
||||
abstract class XML_Feed_Parser_Type
|
||||
{
|
||||
@@ -49,6 +49,11 @@ abstract class XML_Feed_Parser_Type
|
||||
*/
|
||||
public $entries = array();
|
||||
|
||||
/**
|
||||
* Store mappings between entry IDs and their position in the feed
|
||||
*/
|
||||
public $idMappings = array();
|
||||
|
||||
/**
|
||||
* Proxy to allow use of element names as method names
|
||||
*
|
||||
@@ -195,7 +200,7 @@ abstract class XML_Feed_Parser_Type
|
||||
$this->entries[$offset] = new $this->itemClass(
|
||||
$entries->item($offset), $this, $xmlBase);
|
||||
if ($id = $this->entries[$offset]->id) {
|
||||
@$this->idMappings[$id] = $this->entries[$offset];
|
||||
$this->idMappings[$id] = $this->entries[$offset];
|
||||
}
|
||||
} else {
|
||||
throw new XML_Feed_Parser_Exception('No entries found');
|
||||
@@ -219,7 +224,7 @@ abstract class XML_Feed_Parser_Type
|
||||
protected function getDate($method, $arguments)
|
||||
{
|
||||
$time = $this->model->getElementsByTagName($method);
|
||||
if ($time->length == 0) {
|
||||
if ($time->length == 0 || empty($time->item(0)->nodeValue)) {
|
||||
return false;
|
||||
}
|
||||
return strtotime($time->item(0)->nodeValue);
|
||||
@@ -307,12 +312,12 @@ abstract class XML_Feed_Parser_Type
|
||||
$return = '';
|
||||
foreach ($node->attributes as $attribute) {
|
||||
if ($attribute->name == 'src' or $attribute->name == 'href') {
|
||||
$attribute->value = $this->addBase($attribute->value, $attribute);
|
||||
$attribute->value = $this->addBase(htmlentities($attribute->value, NULL, 'utf-8'), $attribute);
|
||||
}
|
||||
if ($attribute->name == 'base') {
|
||||
continue;
|
||||
}
|
||||
$return .= $attribute->name . '="' . $attribute->value .'" ';
|
||||
$return .= $attribute->name . '="' . htmlentities($attribute->value, NULL, 'utf-8') .'" ';
|
||||
}
|
||||
if (! empty($return)) {
|
||||
return ' ' . trim($return);
|
||||
@@ -320,13 +325,34 @@ abstract class XML_Feed_Parser_Type
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert HTML entities based on the current character set.
|
||||
*
|
||||
* @param String
|
||||
* @return String
|
||||
*/
|
||||
function processEntitiesForNodeValue($node)
|
||||
{
|
||||
if (function_exists('iconv')) {
|
||||
$current_encoding = $node->ownerDocument->encoding;
|
||||
$value = iconv($current_encoding, 'UTF-8', $node->nodeValue);
|
||||
} else if ($current_encoding == 'iso-8859-1') {
|
||||
$value = utf8_encode($node->nodeValue);
|
||||
} else {
|
||||
$value = $node->nodeValue;
|
||||
}
|
||||
|
||||
$decoded = html_entity_decode($value, NULL, 'UTF-8');
|
||||
return htmlentities($decoded, NULL, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of our xml:base processing code
|
||||
*
|
||||
* We need a couple of methods to access XHTML content stored in feeds.
|
||||
* This is because we dereference all xml:base references before returning
|
||||
* the element. This method recurs through the tree descending from the node
|
||||
* and builds our string
|
||||
* and builds our string.
|
||||
*
|
||||
* @param DOMElement $node The DOM node we are processing
|
||||
* @return string
|
||||
@@ -349,7 +375,7 @@ abstract class XML_Feed_Parser_Type
|
||||
}
|
||||
|
||||
if ($node instanceof DOMText) {
|
||||
$content .= htmlentities($node->nodeValue);
|
||||
$content .= $this->processEntitiesForNodeValue($node);
|
||||
}
|
||||
|
||||
/* Add the closing of this node to the content */
|
||||
@@ -436,6 +462,14 @@ abstract class XML_Feed_Parser_Type
|
||||
$config = new PEAR_Config;
|
||||
return $config->get('data_dir') . '/XML_Feed_Parser/schemas';
|
||||
}
|
||||
|
||||
public function relaxNGValidate() {
|
||||
$dir = self::getSchemaDir();
|
||||
|
||||
$path = $dir . '/' . $this->relax;
|
||||
|
||||
return $this->model->relaxNGValidate($path);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user