Compare commits

...

39 Commits

Author SHA1 Message Date
Michael RICOIS
1d5578d66b Merge remote-tracking branch 'origin/ticket-14739-PackLogistic' 2018-03-27 10:20:34 +02:00
Michael RICOIS
922de8200a Fix quantity 2018-03-22 11:08:49 +01:00
Michael RICOIS
7699f86acd Save logisitic queue name in configuration 2018-03-21 10:32:59 +01:00
Michael RICOIS
76b26ac6b4 CS 2018-03-21 10:27:58 +01:00
Michael RICOIS
6b863fe940 Fix 2018-03-19 12:27:57 +01:00
Michael RICOIS
34e2bdc553 Merge remote-tracking branch 'origin/ticket/r16490-email_error' 2018-03-19 12:19:16 +01:00
Michael RICOIS
2207ae3cb8 CS 2018-03-19 10:28:19 +01:00
Michael RICOIS
893da877e8 Merge remote-tracking branch 'origin/ticket/r16686-filter_back' 2018-03-19 10:19:01 +01:00
Michael RICOIS
efbcf6327f Remove opening title (not working) 2018-03-19 10:15:54 +01:00
Michael RICOIS
5a605ad905 Fix url : typo 2018-03-19 09:45:28 +01:00
Michael RICOIS
e057c88351 CSS open if values in cookie 2018-03-16 10:12:24 +01:00
Michael RICOIS
93fe8b597a CS 2018-03-16 10:11:38 +01:00
Michael RICOIS
9803b2424c Add filter value in cookie 2018-03-15 17:37:01 +01:00
Michael RICOIS
4691d8bb0f Remove .hg 2018-03-15 15:25:12 +01:00
Michael RICOIS
b5053e443a Merge remote-tracking branch 'origin/ticket/r15862-label_refbbb' 2018-03-14 11:57:07 +01:00
Michael RICOIS
34c962b75e Fix regexp 2018-03-14 11:51:28 +01:00
Michael RICOIS
588fa7e334 Merge branch 'ticket/r15862-label_refbbb' 2018-03-14 11:48:10 +01:00
Michael RICOIS
03cd386f70 New regexp 2018-03-14 11:47:16 +01:00
Michael RICOIS
6d0beefa1c Merge branch 'ticket/r15862-label_refbbb' 2018-03-14 11:29:50 +01:00
Michael RICOIS
2a3e8ebddd Change regexp to detect first - 2018-03-14 11:28:11 +01:00
Michael RICOIS
aca4357353 Fix return link 2018-03-14 09:48:02 +01:00
Michael RICOIS
f2462e6bc3 Merge remote-tracking branch 'origin/ticket/r15862-label_refbbb' 2018-03-13 15:21:51 +01:00
Michael RICOIS
d6dbc5f479 New label format 2018-03-13 15:18:14 +01:00
Michael RICOIS
e54395e5d1 Include file from server 2018-03-13 12:02:24 +01:00
Michael RICOIS
305234f74f CS 2018-03-12 12:58:54 +01:00
Michael RICOIS
37b955667f Merge remote-tracking branch 'origin/ticket/r16455-exclude_bot' 2018-03-12 10:11:36 +01:00
Michael RICOIS
9115434424 Merge remote-tracking branch 'origin/tickets/customer_date_upd' 2018-03-12 10:05:44 +01:00
Michael RICOIS
2343304d25 Merge remote-tracking branch 'origin/ticket/r15109-math-captcha' 2018-03-12 09:50:53 +01:00
Michael RICOIS
ffe8c187e8 Merge remote-tracking branch 'origin/ticket/r16492-bulkupdate' 2018-03-12 09:48:05 +01:00
Michael RICOIS
2985b1ed4f Find tax when update 2018-03-09 12:41:14 +01:00
Michael RICOIS
76eb16036b update date_upd to customer 2018-03-09 11:21:41 +01:00
Michael RICOIS
c86f90f0eb Clean 2018-03-08 11:44:37 +01:00
Michael RICOIS
9edb325f22 Error message 2018-03-06 17:09:30 +01:00
Michael RICOIS
e7551ef018 session_start 2018-03-06 10:33:14 +01:00
Michael RICOIS
4a63488b51 Style 2018-03-05 17:28:11 +01:00
Michael RICOIS
2c870b56f4 Add captcha 2018-03-05 17:05:47 +01:00
Michael RICOIS
bec5a21522 CS 2018-03-05 17:04:58 +01:00
Michael RICOIS
d931f7f081 Exclude Sensefuel bot 2018-03-02 16:27:52 +01:00
Michael RICOIS
197f4161d1 Add New Import 2018-02-26 11:46:03 +01:00
271 changed files with 1775 additions and 540 deletions

View File

@ -79,7 +79,16 @@ class AdminImport extends AdminTab
public function __construct()
{
$this->entities = array_flip(array($this->l('Categories'), $this->l('Products'), $this->l('Combinations'), $this->l('Customers'), $this->l('Addresses'), $this->l('Manufacturers'), $this->l('Suppliers')));
$this->entities = array_flip(array(
$this->l('Categories'),
$this->l('Products'),
$this->l('Combinations'),
$this->l('Customers'),
$this->l('Addresses'),
$this->l('Manufacturers'),
$this->l('Suppliers'),
$this->l('Pack'),
));
switch ((int)(Tools::getValue('entity')))
{
@ -280,7 +289,19 @@ class AdminImport extends AdminTab
'meta_keywords' => array('label' => $this->l('Meta-keywords')),
'meta_description' => array('label' => $this->l('Meta-description')));
break;
case $this->entities[$this->l('Pack')]:
self::$required_fields = array('id_product_item', 'qty', 'id');
$this->available_fields = array(
'id_product_item' => array('label' => $this->l('ID Item')),
'qty' => array('label' => $this->l('Quantity Item')),
'id' => array('label' => $this->l('ID Pack')),
);
break;
}
parent::__construct();
}
@ -1292,6 +1313,51 @@ class AdminImport extends AdminTab
}
$this->closeCsvFile($handle);
}
public function packImport()
{
$this->receiveTab();
$handle = $this->openCsvFile();
self::setLocale();
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
{
if (Tools::getValue('convert')) {
$line = $this->utf8_encode_array($line);
}
$info = self::getMaskedRow($line);
self::setDefaultValues($info);
// Is product a pack
if (array_key_exists('id', $info) && (int)($info['id']) && Pack::isPack((int)($info['id']))) {
$pack = new Pack((int)($info['id']));
}
else {
$pack = new Pack();
}
self::array_walk($info, array('AdminImport', 'fillInfo'), $pack);
if (($fieldError = $pack->validateFields(UNFRIENDLY_ERROR, true)) === true && is_numeric($info['qty']))
{
$res = false;
// Is product item in pack
if ($pack->isPacked($info['id_product_item'])) {
$res = $pack->updateItem($info['id'], $info['id_product_item'], $info['qty']);
}
// Insert
if (!$res) {
$res = $pack->addItem($info['id'], $info['id_product_item'], $info['qty']);
}
if (!$res) {
$this->_errors[] = mysql_error().' '.$info['id_product_item'].(isset($info['id']) ? ' (ID '.$info['id'].')' : '').' '.Tools::displayError('Cannot be saved');
}
}
else {
$this->_errors[] = ($fieldError !== true ? $fieldError : '').($langFieldError !== true ? $langFieldError : '');
}
}
$this->closeCsvFile($handle);
}
public function display()
{
@ -1824,6 +1890,9 @@ class AdminImport extends AdminTab
case $this->entities[$this->l('Suppliers')]:
$this->supplierImport();
break;
case $this->entities[$this->l('Pack')]:
$this->packImport();
break;
default:
$this->_errors[] = $this->l('no entity selected');
}

View File

@ -174,18 +174,30 @@ class PackCore extends Product
}
/**
* Add an item to the pack
*
* @param integer $id_product
* @param integer $id_item
* @param integer $qty
* @return boolean true if everything was fine
*/
* Add an item to the pack
* @param integer $id_product
* @param integer $id_item
* @param integer $qty
* @return boolean true if everything was fine
*/
public static function addItem($id_product, $id_item, $qty)
{
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET cache_is_pack = 1 WHERE id_product = '.(int)($id_product).' LIMIT 1');
return Db::getInstance()->AutoExecute(_DB_PREFIX_.'pack', array('id_product_pack' => (int)($id_product), 'id_product_item' => (int)($id_item), 'quantity' => (int)($qty)), 'INSERT');
}
/**
* Update item and his pack association
* @param integer $id_product
* @param integer $id_item
* @param integer $qty
* @return boolean true if everything was fine
*/
public static function updateItem($id_product, $id_item, $qty)
{
return Db::getInstance()->AutoExecute(_DB_PREFIX_.'pack', array('quantity' => (int)($qty)),
'UPDATE', 'id_product_pack='.(int)($id_product).' AND id_product_item='.(int)($id_item));
}
public static function duplicate($id_product_old, $id_product_new)
{

View File

@ -281,26 +281,26 @@ class TaxCore extends ObjectModel
*/
public static function getProductTaxRate($id_product, $id_address = NULL)
{
$id_country = (int)Country::getDefaultCountryId();
$id_state = 0;
$id_county = 0;
$rate = 0;
if (!empty($id_address))
{
$address_infos = Address::getCountryAndState($id_address);
if ($address_infos['id_country'])
{
$id_country = (int)($address_infos['id_country']);
$id_state = (int)$address_infos['id_state'];
$id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']);
$id_country = (int)Country::getDefaultCountryId();
$id_state = 0;
$id_county = 0;
$rate = 0;
if (!empty($id_address)) {
$address_infos = Address::getCountryAndState($id_address);
if ($address_infos['id_country']) {
$id_country = (int)($address_infos['id_country']);
$id_state = (int)$address_infos['id_state'];
$id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']);
}
if (!empty($address_infos['vat_number']) AND $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') AND Configuration::get('VATNUMBER_MANAGEMENT'))
return 0;
if (!empty($address_infos['vat_number']) AND $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') AND Configuration::get('VATNUMBER_MANAGEMENT')) {
return 0;
}
}
if ($rate = Tax::getProductTaxRateViaRules((int)$id_product, (int)$id_country, (int)$id_state, (int)$id_county))
return $rate;
if ($rate = Tax::getProductTaxRateViaRules((int)$id_product, (int)$id_country, (int)$id_state, (int)$id_county)) {
return $rate;
}
return $rate;
}

View File

@ -34,6 +34,9 @@ function __autoload($className)
return true;
}
if (function_exists('MathCaptcha\mathcaptchaAutoload') && MathCaptcha\mathcaptchaAutoload($className)) {
return true;
}
$className = str_replace(chr(0), '', $className);
$classDir = dirname(__FILE__).'/../classes/';
@ -42,24 +45,23 @@ function __autoload($className)
$file_in_classes = file_exists($classDir.$className.'.php');
// This is a Core class and its name is the same as its declared name
if (substr($className, -4) == 'Core')
if (substr($className, -4) == 'Core') {
require_once($classDir.substr($className, 0, -4).'.php');
else
{
if ($file_in_override && $file_in_classes)
{
}
else {
if ($file_in_override && $file_in_classes) {
require_once($classDir.str_replace(chr(0), '', $className).'.php');
require_once($overrideDir.$className.'.php');
}
elseif (!$file_in_override && $file_in_classes)
{
elseif (!$file_in_override && $file_in_classes) {
require_once($classDir.str_replace(chr(0), '', $className).'.php');
$classInfos = new ReflectionClass($className.((interface_exists($className, false) or class_exists($className, false)) ? '' : 'Core'));
if (!$classInfos->isInterface() && substr($classInfos->name, -4) == 'Core')
eval(($classInfos->isAbstract() ? 'abstract ' : '').'class '.$className.' extends '.$className.'Core {}');
}
elseif ($file_in_override && !$file_in_classes)
elseif ($file_in_override && !$file_in_classes) {
require_once($overrideDir.$className.'.php');
}
}
}

View File

@ -1,6 +1,6 @@
<?php
/*
* 2007-2011 PrestaShop
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
@ -35,71 +35,78 @@ class PasswordControllerCore extends FrontController
{
parent::process();
if (Tools::isSubmit('email'))
{
if (!($email = Tools::getValue('email')) OR !Validate::isEmail($email))
$this->errors[] = Tools::displayError('Invalid e-mail address');
else
{
$customer = new Customer();
$customer->getByemail($email);
if (!Validate::isLoadedObject($customer))
$this->errors[] = Tools::displayError('There is no account registered to this e-mail address.');
else
{
if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0)
$this->errors[] = Tools::displayError('You can regenerate your password only every').' '.(int)($min_time).' '.Tools::displayError('minute(s)');
else
{
if (Mail::Send((int)(self::$cookie->id_lang), 'password_query', Mail::l('Password query confirmation'),
array('{email}' => $customer->email,
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{url}' => self::$link->getPageLink('password.php', true).'?token='.$customer->secure_key.'&id_customer='.(int)$customer->id),
$customer->email,
$customer->firstname.' '.$customer->lastname))
self::$smarty->assign(array('confirmation' => 2, 'email' => $customer->email));
else
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
}
}
}
// Check User Agent - no bot
$userAgent = $_SERVER['HTTP_USER_AGENT'];
if (strstr(strtolower($userAgent), 'bot')) {
$this->errors[] = Tools::displayError("Who are you ?");
}
elseif (($token = Tools::getValue('token')) && ($id_customer = (int)(Tools::getValue('id_customer'))))
{
$email = Db::getInstance()->getValue('SELECT `email` FROM '._DB_PREFIX_.'customer c WHERE c.`secure_key` = \''.pSQL($token).'\' AND c.id_customer = '.(int)$id_customer);
if ($email)
{
$customer = new Customer();
$customer->getByemail($email);
if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0)
Tools::redirect('authentication.php?error_regen_pwd');
else
{
$customer->passwd = Tools::encrypt($password = Tools::passwdGen((int)MIN_PASSWD_LENGTH,'RANDOM'));
$customer->last_passwd_gen = date('Y-m-d H:i:s', time());
if ($customer->update())
{
if (Mail::Send((int)(self::$cookie->id_lang), 'password', Mail::l('Your password'),
array('{email}' => $customer->email,
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{passwd}' => $password),
$customer->email,
$customer->firstname.' '.$customer->lastname))
self::$smarty->assign(array('confirmation' => 1, 'email' => $customer->email));
else
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
if (empty($this->errors)) {
if (Tools::isSubmit('email')) {
if (!($email = Tools::getValue('email')) OR !Validate::isEmail($email)) {
$this->errors[] = Tools::displayError('Invalid e-mail address');
}
else {
$customer = new Customer();
$customer->getByemail($email);
if (!Validate::isLoadedObject($customer)) {
$this->errors[] = Tools::displayError('There is no account registered to this e-mail address.');
}
else {
if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0) {
$this->errors[] = Tools::displayError('You can regenerate your password only every').' '.(int)($min_time).' '.Tools::displayError('minute(s)');
}
else {
if (Mail::Send((int)(self::$cookie->id_lang), 'password_query', Mail::l('Password query confirmation'),
array('{email}' => $customer->email,
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{url}' => self::$link->getPageLink('password.php', true).'?token='.$customer->secure_key.'&id_customer='.(int)$customer->id),
$customer->email,
$customer->firstname.' '.$customer->lastname))
self::$smarty->assign(array('confirmation' => 2, 'email' => $customer->email));
else
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
}
}
else
$this->errors[] = Tools::displayError('An error occurred with your account and your new password cannot be sent to your e-mail. Please report your problem using the contact form.');
}
}
else
elseif (($token = Tools::getValue('token')) && ($id_customer = (int)(Tools::getValue('id_customer')))) {
$email = Db::getInstance()->getValue('SELECT `email` FROM '._DB_PREFIX_.'customer c WHERE c.`secure_key` = \''.pSQL($token).'\' AND c.id_customer = '.(int)$id_customer);
if ($email) {
$customer = new Customer();
$customer->getByemail($email);
if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0) {
Tools::redirect('authentication.php?error_regen_pwd');
}
else {
$customer->passwd = Tools::encrypt($password = Tools::passwdGen((int)MIN_PASSWD_LENGTH,'RANDOM'));
$customer->last_passwd_gen = date('Y-m-d H:i:s', time());
if ($customer->update())
{
if (Mail::Send((int)(self::$cookie->id_lang), 'password', Mail::l('Your password'),
array('{email}' => $customer->email,
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{passwd}' => $password),
$customer->email,
$customer->firstname.' '.$customer->lastname))
self::$smarty->assign(array('confirmation' => 1, 'email' => $customer->email));
else
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
}
else
$this->errors[] = Tools::displayError('An error occurred with your account and your new password cannot be sent to your e-mail. Please report your problem using the contact form.');
}
}
else {
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
}
}
elseif (($token = Tools::getValue('token')) || ($id_customer = Tools::getValue('id_customer'))) {
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
}
}
elseif (($token = Tools::getValue('token')) || ($id_customer = Tools::getValue('id_customer')))
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
}
public function displayContent()

View File

@ -40,7 +40,7 @@
<br /><br /><br />
El dep&oacute;sito del paquete debe hacerse en uno de los 4 500 Puntos de Recogida&reg; de España.
<br />
Encuentre la lista de puntos de recogida cerca de su casa haciendo <a href="http://www.puntopack.es/buscar-el-punto-pack-más-cercano/" target="_blank" style="color: #5082f5; text-decoration: none;">click aquí</a>
Encuentre la lista de puntos de recogida cerca de su casa haciendo <a href="https://www.puntopack.es/buscar-el-punto-pack-mas-cercano/" target="_blank" style="color: #5082f5; text-decoration: none;">click aquí</a>
<br />
El comerciante le entregará un comprobante que deberá conservar para justificar el dep&oacute;sito en caso de ser necesario.
</td>

View File

@ -24,7 +24,7 @@ Pegue la etiqueta proporcionada por Mondial Relay en una de las caras visibles d
El depósito del paquete debe hacerse en uno de los 4 500 Puntos de Recogida de España.
Encuentre la lista de puntos de recogida cerca de su casa haciendo click aquí:
http://www.puntopack.es/buscar-el-punto-pack-más-cercano/
https://www.puntopack.es/buscar-el-punto-pack-mas-cercano/
El comerciante le entregará un comprobante que deberá conservar para justificar el depósito
en caso de ser necesario.

View File

@ -24,7 +24,7 @@
Nous vous informons que vous avez dans votre compte un crédit de fidélité non utilisé suite à votre commande {commandenum}.
Celui-ci expire dans 1 mois.
Venez nous rendre visite sur le site : https://wwww.bebeboutik.com et profiter de nos offres jusqu'à -70% !
Venez nous rendre visite sur le site : https://www.bebeboutik.com et profiter de nos offres jusqu'à -70% !
</td>
</tr>
<tr>

View File

@ -3,6 +3,6 @@ Bonjour {firstname} {lastname},
Nous vous informons que vous avez dans votre compte un crédit de fidélité non utilisé suite à votre commande {commandenum}.
Celui-ci expire dans 1 mois.
Venez nous rendre visite sur le site : https://wwww.bebeboutik.com et profiter de nos offres jusqu'à -70% !
Venez nous rendre visite sur le site : https://www.bebeboutik.com et profiter de nos offres jusqu'à -70% !
L'équipe Bébé Boutik,

View File

@ -0,0 +1,16 @@
<?php
require_once dirname(__FILE__).'/../../config/config.inc.php';
require_once dirname(__FILE__).'/../../init.php';
session_start();
$mathCaptcha = new MathCaptcha\MathCaptcha();
try {
$mathCaptcha->generate();
$mathCaptcha->output();
}
catch ( MathCaptcha\MathCaptchaException $e ) {
// Here you normally log the error, and you can output an error image
// to notify the user that something went wrong, if you want.
}

View File

@ -1,7 +1,10 @@
<?php
require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php');
require_once(dirname(__FILE__).'/Reason.php');
require_once dirname(__FILE__).'/../../config/config.inc.php';
require_once dirname(__FILE__).'/../../init.php';
require_once dirname(__FILE__).'/Reason.php';
session_start();
$controller->preProcess();
$langs = Language::getLanguages();
@ -52,12 +55,18 @@ if (Tools::isSubmit('submitMessage')) {
$fileAttachment['mime'] = $_FILES['fileUpload']['type'];
}
$mathCaptcha = new MathCaptcha\MathCaptcha();
$captcha_ans = Tools::getValue('cans');
$message = Tools::htmlentitiesUTF8(Tools::getValue('message'));
if (Tools::getValue('email2') != '') {
$this->errors[] = Tools::displayError('Invalid');
$errors[] = Tools::displayError('Invalid');
}
elseif ($mathCaptcha->check($captcha_ans) !== true) {
$errors[] = Tools::displayError('For security reasons, thank you to solve the addition to validate the sending of your message');
}
elseif (preg_match("/\p{Han}+/u", $message)) {
$this->errors[] = Tools::displayError('Invalid message');
$errors[] = Tools::displayError('Invalid message');
}
elseif (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from)) {
$errors[] = Tools::displayError('Invalid e-mail address');

View File

@ -176,10 +176,13 @@
<label for="message">{l s='Message' mod='ant_support_form'}</label>
<textarea id="message" name="message">{if isset($message)}{$message|escape:'htmlall':'UTF-8'|stripslashes}{/if}</textarea>
</p>
<p>
<img src="{$base_dir_ssl}c.png" alt="" style="vertical-align:middle;">
<input type="text" name="cans" style="width:40px;padding:0;">
</p>
<p class="submit">
<input type="submit" name="submitMessage" id="submitMessage" value="{l s='Send' mod='ant_support_form'}" class="button_large" onclick="$(this).hide();" />
</p>
</div>
</fieldset>
</form>

Binary file not shown.

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
22140c622301271e8694549e29e360916921e485 0
22140c622301271e8694549e29e360916921e485 default

View File

@ -1,2 +0,0 @@
0 22140c622301271e8694549e29e360916921e485

Binary file not shown.

View File

@ -1,2 +0,0 @@
[paths]
default = ssh://ewen@localhost//hg/blockauth

View File

@ -1,4 +0,0 @@
revlogv1
fncache
store
dotencode

View File

@ -1,5 +0,0 @@
data/logo.gif.i
data/config.xml.i
data/fr.php.i
data/blockauth.php.i
data/blockauth.tpl.i

Binary file not shown.

View File

@ -1 +0,0 @@
default

View File

@ -1,3 +0,0 @@
0
pull
ssh://ewen@localhost//hg/blockauth

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
55a547b9200e199cbe52370d3ee590a2a8237c03 2
55a547b9200e199cbe52370d3ee590a2a8237c03 default

View File

@ -1,2 +0,0 @@
2 55a547b9200e199cbe52370d3ee590a2a8237c03

Binary file not shown.

View File

@ -1,2 +0,0 @@
[paths]
default = ssh://ewen@localhost//hg/blockcartex

View File

@ -1,4 +0,0 @@
revlogv1
fncache
store
dotencode

View File

@ -1,16 +0,0 @@
data/img/index.php.i
data/index.php.i
data/config.xml.i
data/img/icon/delete.gif.i
data/img/icon/index.php.i
data/img/icon/basket_go.png.i
data/blockcart-ajax.php.i
data/img/icon/checkout.png.i
data/blockcart-set-collapse.php.i
data/blockcartex.php.i
data/fr.php.i
data/logo.gif.i
data/ajax-cart.js.i
data/blockcart.tpl.i
data/img/icon/basket.png.i
data/blockcart-json.tpl.i

Binary file not shown.

View File

@ -1 +0,0 @@
default

View File

@ -1,3 +0,0 @@
0
pull
ssh://ewen@localhost//hg/blockcartex

Binary file not shown.

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
a0b6701fd7c40b9759a83fc8e78566aa84a678e2 0
a0b6701fd7c40b9759a83fc8e78566aa84a678e2 default

View File

@ -1,2 +0,0 @@
0 a0b6701fd7c40b9759a83fc8e78566aa84a678e2

Binary file not shown.

View File

@ -1,2 +0,0 @@
[paths]
default = ssh://ewen@localhost//hg/blocklogo

View File

@ -1,4 +0,0 @@
revlogv1
fncache
store
dotencode

View File

@ -1,7 +0,0 @@
data/index.php.i
data/config.xml.i
data/logo.gif.i
data/en.php.i
data/blocklogo.php.i
data/blocklogo.tpl.i
data/fr.php.i

Binary file not shown.

View File

@ -1 +0,0 @@
default

View File

@ -1,3 +0,0 @@
0
pull
ssh://ewen@localhost//hg/blocklogo

View File

@ -537,47 +537,53 @@ class AdminBulkUpdate extends AdminTab {
}
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
} elseif(Tools::isSubmit('submitUploadPrices')) {
}
// MAJ Rapide produits (Reduction, Prix d'achat HT, Prix d'achat TTC)
elseif(Tools::isSubmit('submitUploadPrices'))
{
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
fgetcsv($f, 0, ';');
$products = array();
$prices = array();
if(Tools::getValue('price_process') == 2) {
while($line = fgetcsv($f, 0, ';')) {
if(empty($line[0])) {
if (Tools::getValue('price_process') == 2) {
while ($line = fgetcsv($f, 0, ';')) {
if (empty($line[0])) {
continue;
}
$products[] = (int) $line[0];
}
} elseif(Tools::getValue('price_process') == 3
|| Tools::getValue('price_process') == 4){
while($line = fgetcsv($f, 0, ';')) {
if(empty($line[0])) {
}
// Prix d'achat HT || Prix public TTC
elseif (Tools::getValue('price_process') == 3 || Tools::getValue('price_process') == 4) {
while ($line = fgetcsv($f, 0, ';')) {
if (empty($line[0])) {
continue;
}
$prices[] = array(
(int) $line[0],
$line[1]
(int) $line[0],
$line[1]
);
}
}else {
while($line = fgetcsv($f, 0, ';')) {
if(empty($line[0])) {
}
// Reduction
else {
while ($line = fgetcsv($f, 0, ';')) {
if (empty($line[0])) {
continue;
}
if(!isset($line[1])) {
if (!isset($line[1])) {
continue;
}
$products[] = (int) $line[0];
$prices[] = array(
(int) $line[0],
(float) $line[1] > 1? (float) $line[1] / 100: (float) $line[1]
(float) $line[1] > 1 ? (float) $line[1] / 100: (float) $line[1]
);
}
@ -585,17 +591,18 @@ class AdminBulkUpdate extends AdminTab {
fclose($f);
if(Tools::getValue('price_process') == 1
|| Tools::getValue('price_process') == 2) {
// Reduction || ...
if (Tools::getValue('price_process') == 1 || Tools::getValue('price_process') == 2) {
Db::getInstance()->ExecuteS('
DELETE FROM `'._DB_PREFIX_.'specific_price`
WHERE `id_product` IN ('.implode(', ', $products).')
');
}
if(Tools::getValue('price_process') == 1) {
foreach($prices as $price) {
if((int) $price[0] != 0) {
// Reduction
if (Tools::getValue('price_process') == 1) {
foreach ($prices as $price) {
if ((int) $price[0] != 0) {
Db::getInstance()->ExecuteS('
INSERT INTO `'._DB_PREFIX_.'specific_price` VALUES (
DEFAULT,
@ -617,51 +624,64 @@ class AdminBulkUpdate extends AdminTab {
}
}
}
if(Tools::getValue('price_process') == 3) {
foreach($prices as $price) {
if((int) $price[0] != 0){
// Prix d'achat HT
if (Tools::getValue('price_process') == 3) {
foreach ($prices as $price) {
if ((int) $price[0] != 0){
$price[1] = str_replace(',', '.', $price[1]);
$price_ht = floatval($price[1]);
Db::getInstance()->ExecuteS('
UPDATE `'._DB_PREFIX_.'product`
SET wholesale_price = '. (float)$price_ht .'
WHERE id_product ='. (int)$price[0]);
}else{
} else {
$output .= '<p class="error">ID produit à 0, ligne non traitée : '.serialize($price).'</p>';
}
}
}
if(Tools::getValue('price_process') == 4) {
foreach($prices as $price) {
if((int) $price[0] != 0){
// Prix public TTC
if (Tools::getValue('price_process') == 4) {
foreach ($prices as $price) {
if ((int) $price[0] != 0){
$price[1] = str_replace(',', '.', $price[1]);
$price_ht = floatval($price[1] / 1.20);
// Find Tax for this id product
// product.id_tax_rules_group => tax_rules_group => tax_rule => tax.rate
$tax = new Tax();
$taxValue = $tax->getProductTaxRate((int)$price[0]);
if ($taxValue == 0) {
$taxValue = 20;
}
$price_ht = floatval($price[1] / (1 + $taxValue / 100) );
Db::getInstance()->ExecuteS('
UPDATE `'._DB_PREFIX_.'product`
SET price = '. (float)$price_ht .'
WHERE id_product ='. (int)$price[0]);
}else{
} else {
$output .= '<p class="error">ID produit à 0, ligne non traitée : '.serialize($price).'</p>';
}
}
}
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
} elseif(Tools::isSubmit('submitUploadProductDescriptions')) {
}
elseif (Tools::isSubmit('submitUploadProductDescriptions')) {
$id_lang = Tools::getValue('description_process');
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
fgetcsv($f, 0, ';');
$products = array();
while($line = fgetcsv($f, 0, ';')) {
if($line[0] == '' || $line[1] == '') {
while ($line = fgetcsv($f, 0, ';')) {
if ($line[0] == '' || $line[1] == '') {
continue;
}
$products[] = $line;
}
foreach($products as $line) {
foreach ($products as $line) {
$result = Db::getInstance()->ExecuteS('
UPDATE `'._DB_PREFIX_.'product_lang`
SET `description` = "'. pSQL($line[1],true) .'"
@ -675,14 +695,15 @@ class AdminBulkUpdate extends AdminTab {
fclose($f);
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
} elseif(Tools::isSubmit('submitUploadCombinations')) {
}
elseif (Tools::isSubmit('submitUploadCombinations')) {
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
fgetcsv($f, 0, ';');
$products = array();
while($line = fgetcsv($f, 0, ';')) {
if(empty($line[0])) {
while ($line = fgetcsv($f, 0, ';')) {
if (empty($line[0])) {
continue;
}
@ -713,7 +734,7 @@ class AdminBulkUpdate extends AdminTab {
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
} elseif(Tools::isSubmit('submitExportDeb')){
} elseif (Tools::isSubmit('submitExportDeb')){
set_time_limit(300);
$id_lang = Tools::getValue('id_lang', $cookie->id_lang);
$deb = Tools::getValue('deb', 0);

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
613b481451e73594f52e08e2a35120c98652d63c 3
613b481451e73594f52e08e2a35120c98652d63c default

View File

@ -1,2 +0,0 @@
3 613b481451e73594f52e08e2a35120c98652d63c

Binary file not shown.

View File

@ -1,2 +0,0 @@
[paths]
default = ssh://ewen@localhost//hg/categoryscroll

View File

@ -1,4 +0,0 @@
revlogv1
fncache
store
dotencode

Some files were not shown because too many files have changed in this diff Show More