Compare commits

...

75 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
a4625499c0 Override email value 2018-03-15 11:21:41 +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
eea2e769d1 Remove break point 2018-03-14 11:17:26 +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
1920a84634 Add rules 2018-03-12 11:52:00 +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
d1d0642f91 Add a better way to correct email - to test 2018-03-09 17:54:36 +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
62139fe9fd Merge remote-tracking branch 'origin/ticket/r15862-label_refbbb' 2018-03-08 17:36:23 +01:00
Michael RICOIS
ba7f3d2223 Test 2018-03-08 17:35:26 +01:00
Michael RICOIS
887c687dd1 Change dimension 2018-03-08 17:30:25 +01:00
Michael RICOIS
9e386209d7 Fix 2018-03-08 17:24:53 +01:00
Michael RICOIS
87387701c3 Remove ajax cache 2018-03-08 17:14:38 +01:00
Michael RICOIS
eed8873dc5 Merge remote-tracking branch 'origin/ticket/r15862-label_refbbb' 2018-03-08 16:42:47 +01:00
Michael RICOIS
cab5635c8f Test format image 2018-03-08 16:29:11 +01:00
Michael RICOIS
fc107f5d6d Merge branch 'ticket/r16348-credit-expired' 2018-03-08 14:59:05 +01:00
Michael RICOIS
490baf50f4 Clean 2018-03-08 14:57:54 +01:00
Michael RICOIS
1d5eb5ec97 New label 2018-03-08 14:54:52 +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
0b835a3af5 New button 2018-03-06 14:34:46 +01:00
Michael RICOIS
c658d0ec75 Use description_short as description 2018-03-06 10:42:58 +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
d7cce43d8f Merge branch 'ticket/r14810-dropshipping-tracking' 2018-03-05 12:59:56 +01:00
Michael RICOIS
633c8e77e4 Merge remote-tracking branch 'origin/fix/mobile_detect' 2018-03-05 12:59:15 +01:00
Michael RICOIS
322c019c5c Merge remote-tracking branch 'origin/ticket/r16159-customer-message' 2018-03-05 09:49:15 +01:00
Michael RICOIS
97f8d56b5e Update Mobile_Detect to version 2.8.31 2018-03-02 16:44:00 +01:00
Michael RICOIS
d931f7f081 Exclude Sensefuel bot 2018-03-02 16:27:52 +01:00
Michael RICOIS
7208390679 Typo 2018-03-01 16:29:55 +01:00
Michael RICOIS
9e010d63d6 Typo 2018-03-01 16:27:27 +01:00
Michael RICOIS
5a6ff9c962 Remove credit expired 2018-02-27 17:48:02 +01:00
Michael RICOIS
197f4161d1 Add New Import 2018-02-26 11:46:03 +01:00
Michael RICOIS
d307e50f7f Get back to date_upd 2018-02-23 12:19:46 +01:00
Michael RICOIS
a09de51ac2 Reset date_upd 2018-02-23 12:10:14 +01:00
Michael RICOIS
2cdfbdb833 Date update only if it's a thread 2018-02-22 17:56:47 +01:00
Michael RICOIS
cf142b7071 CS 2018-02-22 17:54:49 +01:00
Michael RICOIS
013e705e94 Use date_add 2018-02-16 16:32:15 +01:00
Michael RICOIS
e01ffd309f CS 2018-02-05 12:50:19 +01:00
Michael RICOIS
b0cafcbe70 Email for dropshipping without carrier info 2018-02-05 12:26:27 +01:00
Michael RICOIS
d7ea10a2bb Mails 2018-02-02 12:28:49 +01:00
Michael RICOIS
2c91058ece Text 2018-01-31 12:36:51 +01:00
Michael RICOIS
9cadd3e8af Don't save shipping number in dropshipping 2018-01-31 12:05:57 +01:00
Michael RICOIS
70afb97e26 Column name 2018-01-31 11:34:17 +01:00
Michael RICOIS
8b15ef46a6 Rework for dropshipping 2018-01-30 17:15:33 +01:00
Michael RICOIS
0b787dd69b Comment 2018-01-25 17:21:15 +01:00
291 changed files with 3107 additions and 856 deletions

View File

@ -127,7 +127,7 @@ if (isset($_GET['ajaxDiscountCustomers']))
$filter = Tools::getValue('filter');
$filterWithIdCustomer = false;
if (strpos($filter, '_')) {
if (strpos($filter, '0_') === 0) {
$filterArray = explode('_', $filter);
$filter = $filterArray[1];
$filterWithIdCustomer = true;

View File

@ -38,17 +38,21 @@ class AdminCustomerThreads extends AdminTab
$this->view = true;
$this->delete = true;
$this->_select = 'CONCAT(c.firstname," ",c.lastname) as customer, cl.name as contact, l.name as language, group_concat(message) as messages, (
SELECT IFNULL(CONCAT(LEFT(e.firstname, 1),". ",e.lastname), "--")
FROM '._DB_PREFIX_.'customer_message cm2 INNER JOIN '._DB_PREFIX_.'employee e ON e.id_employee = cm2.id_employee
WHERE cm2.id_employee > 0 AND cm2.`id_customer_thread` = a.`id_customer_thread`
ORDER BY cm2.date_add DESC LIMIT 1) as employee';
$this->_select = '
CONCAT(c.firstname, " ", c.lastname) as customer, cl.name as contact,
l.name as language, group_concat(message) as messages,
(SELECT IFNULL(CONCAT(LEFT(e.firstname, 1), ". ", e.lastname), "--")
FROM '._DB_PREFIX_.'customer_message cm2 INNER JOIN '._DB_PREFIX_.'employee e ON e.id_employee = cm2.id_employee
WHERE cm2.id_employee > 0 AND cm2.`id_customer_thread` = a.`id_customer_thread`
ORDER BY cm2.date_add DESC LIMIT 1
) as employee';
$this->_group = 'GROUP BY cm.id_customer_thread';
$this->_join = '
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = a.`id_customer`
LEFT JOIN `'._DB_PREFIX_.'customer_message` cm ON cm.`id_customer_thread` = a.`id_customer_thread`
LEFT JOIN `'._DB_PREFIX_.'lang` l ON l.`id_lang` = a.`id_lang`
LEFT JOIN `'._DB_PREFIX_.'contact_lang` cl ON (cl.`id_contact` = a.`id_contact` AND cl.`id_lang` = '.(int)$cookie->id_lang.')';
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = a.`id_customer`
LEFT JOIN `'._DB_PREFIX_.'customer_message` cm ON cm.`id_customer_thread` = a.`id_customer_thread`
LEFT JOIN `'._DB_PREFIX_.'lang` l ON l.`id_lang` = a.`id_lang`
LEFT JOIN `'._DB_PREFIX_.'contact_lang` cl ON (cl.`id_contact` = a.`id_contact` AND cl.`id_lang` = '.(int)$cookie->id_lang.')';
$contactArray = array();
$contacts = Contact::getContacts($cookie->id_lang);

View File

@ -381,10 +381,11 @@ class AdminDiscounts extends AdminTab
function fillCustomersAjax()
{
var filterValue = \''.(($value = (int)($this->getFieldValue($obj, 'id_customer'))) ? '0_'.$value : (($value = (int)($this->getFieldValue($obj, 'id_group'))) ? '1_'.$value : '')).'\';
if ($(\'#filter\').val())
if ($(\'#filter\').val()) {
filterValue = $(\'#filter\').val();
$.getJSON("'.dirname($currentIndex).'/ajax.php",{ajaxDiscountCustomers:1,filter:filterValue},
}
$.ajaxSetup({ cache: false });
$.getJSON("'.dirname($currentIndex).'/ajax.php", {ajaxDiscountCustomers:1, filter:filterValue},
function(obj) {
var groups_length = obj.groups.length;
if (obj.groups.length == 0)

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

@ -184,7 +184,7 @@ class OrderCore extends ObjectModel
/* MySQL does not allow 'order' for a table name */
protected $table = 'orders';
protected $identifier = 'id_order';
protected $_taxCalculationMethod = PS_TAX_EXC;
protected $_taxCalculationMethod = PS_TAX_EXC;
protected static $_historyCache = array();
@ -449,9 +449,9 @@ class OrderCore extends ObjectModel
if ($row['group_reduction'] > 0)
{
if ($this->_taxCalculationMethod == PS_TAX_EXC)
$row['product_price'] = $row['product_price'] * $group_reduction;
$row['product_price'] = $row['product_price'] * $group_reduction;
else
$row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] * $group_reduction , 2);
$row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] * $group_reduction , 2);
}
if (($row['reduction_percent'] OR $row['reduction_amount'] OR $row['group_reduction']) AND $this->_taxCalculationMethod == PS_TAX_EXC)
@ -526,7 +526,7 @@ class OrderCore extends ObjectModel
/**
* Check if order contains (only) virtual products
*
*
* @param boolean $strict If false return true if there are at least one product virtual
* @return boolean true if is a virtual order or false
*
@ -922,7 +922,7 @@ class OrderCore extends ObjectModel
// I use mysql 4, I can't make sub query in FROM
$number = Order::getLastInvoiceNumber() + 1;
}
else
else
$number = '(SELECT `invoice_number`
FROM (
SELECT MAX(`invoice_number`) + 1 AS `invoice_number`

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

@ -145,7 +145,7 @@ class OrderDetailControllerCore extends FrontController
'messages' => Message::getMessagesByOrderId((int)($order->id)),
'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
'isRecyclable' => Configuration::get('PS_RECYCLABLE_PACK'),
'isRecyclable' => Configuration::get('PS_RECYCLABLE_PACK'),
'use_tax' => Configuration::get('PS_TAX'),
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
'customizedDatas' => $customizedDatas));

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

@ -0,0 +1,51 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message de {shop_name}</title>
</head>
<body>
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 550px;">
<tr>
<td align="left">
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">Bonjour <strong>{firstname} {lastname}</strong>,</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Vous avez pass&eacute; commande r&eacute;cemment sur notre site B&eacute;b&eacute; Boutik.
Nous vous informons que le/les produits de la marque {sale} pour votre commande n&#176;{id_order} vient d'être envoy&eacute; directement de chez notre fournisseur.
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Vous recevrez votre commande prochainement.
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
A très vite sur B&eacute;b&eacute; Boutik !
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Cordialement,
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="center" style="font-size: 12px; border-top: 1px solid #cccccc; padding-top: 5px;">
{shop_name} - <a href="{shop_url}" style="color: #e26ea2;">{shop_url}</a>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,11 @@
Bonjour {firstname} {lastname}
Vous avez passé commande récemment sur notre site Bébé Boutik. Nous vous informons que le/les produits de la marque {sale} pour votre commande n°{id_order} vient d'être envoyé directement de chez notre fournisseur.
Vous recevrez votre commande prochainement.
A très vite sur Bébé Boutik !
Cordialement,
{shop_name} - {shop_url}

View File

@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message de {shop_name}</title>
</head>
<body>
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 550px;">
<tr>
<td align="left">
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">Buenos días <strong>{firstname} {lastname},</strong>,</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Te informamos de que el/los producto(s) de la marca {sale} de tu pedido nº{id_order}, te los ha enviado directamente el proveedor a la dirección que nos has indicado.
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Recibirás tu pedido en breve.
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
¡Hasta pronto! ¡Nos vemos en Bébé Boutik!
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="center" style="font-size: 12px; border-top: 1px solid #cccccc; padding-top: 5px;">
{shop_name} - <a href="{shop_url}" style="color: #e26ea2;">{shop_url}</a>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,11 @@
Buenos días {firstname} {lastname},
Recientemente has pasado pedido en Bébé Boutik y te damos las gracias.
Te informamos de que el/los producto(s) de la marca {sale} de tu pedido nº{id_order}, te los ha enviado directamente el proveedor a la dirección que nos has indicado.
Recibirás tu pedido en breve.
¡Hasta pronto! ¡Nos vemos en Bébé Boutik!
{shop_name} - {shop_url}

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

@ -18,7 +18,8 @@
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Vous avez pass&eacute; commande r&eacute;cemment sur notre site B&eacute;b&eacute; Boutik. Nous vous informons que le/les produits de la marque {sale} pour votre commande n&#176;{id_order} vient d'être envoy&eacute; directement de chez notre fournisseur par le transporteur {carrier}.
Vous avez pass&eacute; commande r&eacute;cemment sur notre site B&eacute;b&eacute; Boutik.
Nous vous informons que le/les produits de la marque {sale} pour votre commande n&#176;{id_order} vient d'être envoy&eacute; directement de chez notre fournisseur par le transporteur {carrier}.
</td>
</tr>
<tr><td>&nbsp;</td></tr>
@ -30,7 +31,7 @@
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Vous pourrez consulter l'acheminnement de votre colis à l'adresse suivante : <a href="{followup}" style="color: #e26ea2;">{followup}</a>
Vous pourrez consulter l'acheminement de votre colis à l'adresse suivante : <a href="{followup}" style="color: #e26ea2;">{followup}</a>
</td>
</tr>
<tr><td>&nbsp;</td></tr>

View File

@ -4,7 +4,7 @@ Vous avez passé commande récemment sur notre site Bébé Boutik. Nous vous inf
Voici votre numéro de suivi : {tracking_number}
Vous pourrez consulter l'acheminnement de votre colis à l'adresse suivante : {followup}
Vous pourrez consulter l'acheminement de votre colis à l'adresse suivante : {followup}
A très vite sur Bébé Boutik !

View File

@ -0,0 +1,51 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message de {shop_name}</title>
</head>
<body>
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 550px;">
<tr>
<td align="left">
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">Bonjour <strong>{firstname} {lastname}</strong>,</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Vous avez pass&eacute; commande r&eacute;cemment sur notre site B&eacute;b&eacute; Boutik.
Nous vous informons que le/les produits de la marque {sale} pour votre commande n&#176;{id_order} vient d'être envoy&eacute; directement de chez notre fournisseur.
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Vous recevrez votre commande prochainement.
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
A très vite sur B&eacute;b&eacute; Boutik !
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
Cordialement,
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="center" style="font-size: 12px; border-top: 1px solid #cccccc; padding-top: 5px;">
{shop_name} - <a href="{shop_url}" style="color: #e26ea2;">{shop_url}</a>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,11 @@
Bonjour {firstname} {lastname}
Vous avez passé commande récemment sur notre site Bébé Boutik. Nous vous informons que le/les produits de la marque {sale} pour votre commande n°{id_order} vient d'être envoyé directement de chez notre fournisseur.
Vous recevrez votre commande prochainement.
A très vite sur Bébé Boutik !
Cordialement,
{shop_name} - {shop_url}

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

@ -1,9 +1,10 @@
<?php
if(!defined('_PS_VERSION_')) {
if (!defined('_PS_VERSION_')) {
exit;
}
include_once(_PS_ROOT_DIR_.'/modules/privatesales/Sale.php');
require_once(PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php');
require_once _PS_ROOT_DIR_.'/modules/privatesales/Sale.php';
require_once PS_ADMIN_DIR .'/helpers/HelperFormBootstrap.php';
class AdminAntDropshippingtracking extends AdminTab
{
@ -20,10 +21,13 @@ class AdminAntDropshippingtracking extends AdminTab
}
}
public function _postProcess() {
if(Tools::isSubmit('submitOrderTracking') && Tools::getValue('id_sale')){
public function _postProcess()
{
$this->_html = '';
if ($id_sale = Tools::getValue('id_sale')) {
// Selection des produits de la vente
$errors = 0;
$id_sale = (int)Tools::getValue('id_sale');
$sale_names = array();
foreach(Db::getInstance()->ExecuteS('
SELECT c.`name`, c.`id_lang`
@ -41,41 +45,114 @@ class AdminAntDropshippingtracking extends AdminTab
') as $key => $row) {
$sale_products[(int)$row['id_product']] = (int)$row['id_product'];
}
if(isset($_FILES['csvfile']) && $_FILES['csvfile']['name'] != '') {
$infosTrackingEnable = $infosTrackingDisable = 0;
// Fichier avec infos tracking
if (Tools::isSubmit('submitOrderTracking')) {
$infosTrackingEnable = 1;
}
// Fichier sans infos de tracking
if (Tools::isSubmit('submitOrderTrackingNull')) {
$infosTrackingDisable = 1;
}
// Gestion du fichier CSV
$orders = array();
if (isset($_FILES['csvfile']) && $_FILES['csvfile']['name'] != '') {
$cols = array(
'id_order',
'tracking_number',
'carrier',
'link',
);
$i = 0;
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
fgetcsv($f, 0, ';');
$i = 1;
$orders = array();
while($line = fgetcsv($f, 0, ';')) {
while ($data = fgetcsv($f, 0, ';')) {
$i++;
$orders[(int) $line[0]] = array(
'id_order' => (int) $line[0],
'tracking_number' => trim($line[1]),
'carrier' => $line[2],
'link' => trim($line[3]),
if ($i == 1) {
continue;
}
// Get Data
$num = count($data);
// Check line integrity
if ($num != count($cols)) {
$orders = array();
break;
}
// Assign var
$line = array();
for ($c=0; $c<$num; $c++) {
$name = $cols[$c];
switch ($name) {
case 'tracking_number':
case 'link';
$line[$name] = trim($data[$c]);
break;
default:
$line[$name] = $data[$c];
break;
}
}
// Vérification des données
if ($infosTrackingDisable == 1) {
if ($line['tracking_number'] != ''){
$orders = array();
break;
}
if ($line['link'] != ''){
$orders = array();
break;
}
}
if ($infosTrackingEnable == 1) {
if ($line['tracking_number'] == ''){
$orders = array();
break;
}
if ($line['link'] == ''){
$orders = array();
break;
}
}
// Assign orders
$orders[(int) $line['id_order']] = array(
'id_order' => (int)$line['id_order'],
'tracking_number' => $line['tracking_number'],
'carrier' => $line['carrier'],
'link' => $line['link'],
);
}
if(!empty($orders)) {
foreach ($orders as $id_order => $o) {
if($id_order != 0){
$order = new Order((int)$id_order);
if(Validate::isLoadedObject($order)) {
$order_details = array();
foreach(Db::getInstance()->ExecuteS('
SELECT DISTINCT `id_order_detail`, `product_name`,`product_id`, `product_attribute_id`, `product_quantity` - GREATEST(`product_quantity_return`, `product_quantity_refunded`) AS `quantity`
FROM `'._DB_PREFIX_.'order_detail`
WHERE `id_order` = '.(int) $id_order.'
') as $key => $row) {
$order_details[(int)$row['id_order_detail']] = $row;
}
$fully_sent = false;
$products_sent = array();
foreach(Db::getInstance()->ExecuteS('
}
else {
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Fichier manquant !'));
}
// Traitement des commandes
if (count($orders) > 0) {
foreach ($orders as $id_order => $o) {
if ($id_order != 0) {
$order = new Order((int)$id_order);
if (Validate::isLoadedObject($order)) {
$order_details = array();
foreach (Db::getInstance()->ExecuteS('
SELECT DISTINCT `id_order_detail`, `product_name`,`product_id`, `product_attribute_id`, `product_quantity` - GREATEST(`product_quantity_return`, `product_quantity_refunded`) AS `quantity`
FROM `'._DB_PREFIX_.'order_detail`
WHERE `id_order` = '.(int) $id_order.'
') as $key => $row) {
$order_details[(int)$row['id_order_detail']] = $row;
}
$fully_sent = false;
// Calcul des produits déjà envoyés par LaPoste
$products_sent = array();
foreach (Db::getInstance()->ExecuteS('
SELECT d.`id_order_detail`, IF(
(d.`product_quantity` - IF(
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
@ -87,12 +164,13 @@ class AdminAntDropshippingtracking extends AdminTab
WHERE d.`id_order` = '.(int) $order->id.'
GROUP BY d.`id_order_detail`
') as $quantity_remain) {
if((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
if ((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
foreach(Db::getInstance()->ExecuteS('
}
// Calcul des produits déjà envoyé Exapaq
foreach (Db::getInstance()->ExecuteS('
SELECT d.`id_order_detail`, IF(
(d.`product_quantity` - IF(
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
@ -104,12 +182,13 @@ class AdminAntDropshippingtracking extends AdminTab
WHERE d.`id_order` = '.(int) $order->id.'
GROUP BY d.`id_order_detail`
') as $quantity_remain) {
if((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
if ((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
foreach(Db::getInstance()->ExecuteS('
}
// Calcul des produits déjà envoyé MondialRelay
foreach (Db::getInstance()->ExecuteS('
SELECT d.`id_order_detail`, IF(
(d.`product_quantity` - IF(
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
@ -121,12 +200,13 @@ class AdminAntDropshippingtracking extends AdminTab
WHERE d.`id_order` = '.(int) $order->id.'
GROUP BY d.`id_order_detail`
') as $quantity_remain) {
if((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
if ((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
foreach(Db::getInstance()->ExecuteS('
}
// Calcul des produits déjà envoyé Philea
foreach (Db::getInstance()->ExecuteS('
SELECT d.`id_order_detail`, IF(
(d.`product_quantity` - IF(
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
@ -138,12 +218,13 @@ class AdminAntDropshippingtracking extends AdminTab
WHERE d.`id_order` = '.(int) $order->id.'
GROUP BY d.`id_order_detail`
') as $quantity_remain) {
if((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
if ((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
foreach(Db::getInstance()->ExecuteS('
}
// Calcul des produits déjà envoyé Dropshipping
foreach (Db::getInstance()->ExecuteS('
SELECT d.`id_order_detail`, IF(
(d.`product_quantity` - IF(
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
@ -155,17 +236,21 @@ class AdminAntDropshippingtracking extends AdminTab
WHERE d.`id_order` = '.(int) $order->id.'
GROUP BY d.`id_order_detail`
') as $quantity_remain) {
if((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
if ((int) $quantity_remain['remain'] == 0) {
$products_sent[] = (int) $quantity_remain['id_order_detail'];
}
$remaining = array();
$html_products_sent = '';
foreach($order_details as $id_order_detail => $d) {
if(!in_array($id_order_detail, $products_sent) && !in_array($d['product_id'],$sale_products)) {
$remaining[] = (int)$id_order_detail;
} elseif(!in_array($id_order_detail, $products_sent) && in_array((int)$d['product_id'],$sale_products)) {
$html_products_sent .= '<br />'."\r\n".$d['quantity'] . 'x' . ' ' . $p['product_name'];
}
$remaining = array();
foreach($order_details as $id_order_detail => $d) {
// Calcul des produits restant
if (!in_array($id_order_detail, $products_sent) && !in_array($d['product_id'], $sale_products)) {
$remaining[] = (int)$id_order_detail;
}
// Marquage envoi
elseif (!in_array($id_order_detail, $products_sent) && in_array((int)$d['product_id'],$sale_products)) {
if ($infosTrackingEnable == 1) {
Db::getInstance()->ExecuteS('
INSERT INTO `'._DB_PREFIX_.'ant_dropshipping_parcel`
VALUES (
@ -178,14 +263,51 @@ class AdminAntDropshippingtracking extends AdminTab
)
');
}
if ($infosTrackingDisable == 1) {
// Supprimer tracking_number et link
Db::getInstance()->ExecuteS('
INSERT INTO `'._DB_PREFIX_.'ant_dropshipping_parcel`
VALUES (
'.(int) $id_order_detail.',
'.(int) $d['quantity'].',
"",
"NOTRACKING",
"",
NOW()
)
');
}
}
if(count($remaining) == 0) {
$fully_sent = true;
} else {
$fully_sent = false;
}
}
if (count($remaining) == 0) {
$fully_sent = true;
} else {
$fully_sent = false;
}
$history = new OrderHistory();
$history->id_order = (int) $order->id;
$history->changeIdOrderState(($fully_sent ? Configuration::get('PS_OS_SHIPPING') : 17), (int) $order->id);
$history->id_employee = 0;
$history->add();
// Send Mail with tracking info
if ($infosTrackingEnable == 1) {
Db::getInstance()->ExecuteS('
INSERT INTO `'._DB_PREFIX_.'shipping_history`
VALUES (
'.(int) $order->id.',
"'.pSQL($o['tracking_number']).'",
NOW(),
0,
'.(int)$id_sale.'
)
');
global $_LANGMAIL;
$subject = 'Package in transit';
$customer = new Customer((int) $order->id_customer);
$templateVars = array(
'{followup}' => $o['link'],
@ -195,59 +317,59 @@ class AdminAntDropshippingtracking extends AdminTab
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
'{id_order}' => (int) $order->id,
// '{product_list}' => !empty($html_products_sent)? $content_html.$html_products_sent: '',
// '{product_list_txt}' => !empty($html_products_sent)? $content_txt.strip_tags($html_products_sent): '',
);
$history = new OrderHistory();
$history->id_order = (int) $order->id;
$history->changeIdOrderState(($fully_sent? Configuration::get('PS_OS_SHIPPING'): 17), (int) $order->id);
$history->id_employee = 0;
$history->add();
Db::getInstance()->ExecuteS('
INSERT INTO `'._DB_PREFIX_.'shipping_history`
VALUES (
'.(int) $order->id.',
"'.pSQL($o['shipping_number']).'",
NOW(),
0,
'.(int)$id_sale.'
)
');
global $_LANGMAIL;
$subject = 'Package in transit';
if(!Mail::Send(intval($order->id_lang), 'in_transit_dropshipping', ((is_array($_LANGMAIL) && key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname)){
$errors++;
if (!Mail::Send(intval($order->id_lang), 'in_transit_dropshipping',
((is_array($_LANGMAIL) && key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject),
$templateVars, $customer->email, $customer->firstname.' '.$customer->lastname)) {
$errors++;
}
}
// Send Mail without tracking info
if ($infosTrackingDisable == 1) {
$subject = 'Package in transit';
$customer = new Customer((int) $order->id_customer);
$templateVars = array(
'{sale}' => $sale_names[(int)$order->id_lang],
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
'{id_order}' => (int) $order->id,
);
if (!Mail::Send(intval($order->id_lang), 'in_transit_dropshipping_noinfo',
((is_array($_LANGMAIL) && key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject),
$templateVars, $customer->email, $customer->firstname.' '.$customer->lastname)) {
$errors++;
}
}
}
if ($errors == 0) {
$this->_html .= HelperFormBootstrap::displaySuccess($this->l('Fichier importé avec succès !'));
} else {
$this->_html .= HelperFormBootstrap::displayErrors($this->l($errors.' mails n\'ont pas pu être envoyés'));
}
}
if(!isset($_COOKIE['logistics_sales'])){
setcookie('logistics_sales', $id_sale, 0, __PS_BASE_URI__);
} else {
$sales = explode('-', $_COOKIE['logistics_sales']);
if(!in_array($id_sale,$sales)){
$sales[] = $id_sale;
}
setcookie('logistics_sales', implode('-', $sales), 0, __PS_BASE_URI__);
}
if($errors==0){
$this->_html .= HelperFormBootstrap::displaySuccess($this->l('Fichier importé avec succès !'));
} else {
$this->_html .= HelperFormBootstrap::displayErrors($this->l($errors.' mails n\'ont pas pu être envoyés'));
}
} else {
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Aucune commande trouvée, vérifier votre fichier'));
}
} else {
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Fichier manquant !'));
// Cookie
if (!isset($_COOKIE['logistics_sales'])){
setcookie('logistics_sales', $id_sale, 0, __PS_BASE_URI__);
} else {
$sales = explode('-', $_COOKIE['logistics_sales']);
if(!in_array($id_sale,$sales)){
$sales[] = $id_sale;
}
setcookie('logistics_sales', implode('-', $sales), 0, __PS_BASE_URI__);
}
}
else {
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Aucune commande trouvée, vérifier votre fichier'));
}
}
}
public function display() {
public function display()
{
global $cookie, $currentIndex;
$base_link = $currentIndex . '&token='.Tools::getAdminTokenLite('AdminAntDropshippingtracking');
@ -287,10 +409,12 @@ class AdminAntDropshippingtracking extends AdminTab
</div>
<div class="panel-content">
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<div class="col-md-5 col-md-offset-4">';
<div class="col-md-12">';
$help = '<br>
<p class="help-block">'.$this->l('Format: id_order;tracking_number;carrier;tracking_link').'</p>
<p class="help-block">'.$this->l('The subsequent columns and the first line are ignored.').'</p>
<p class="help-block">'.$this->l('With tracking infos, all columns must be set.').'</p>
<p class="help-block">'.$this->l('Without tracking infos, use the same format but columns tracking_number, carrier and tracking_link must be empty.').'</p>
';
$input = array(
'label' => $this->l('Sale: '),
@ -313,13 +437,15 @@ class AdminAntDropshippingtracking extends AdminTab
<div class="clearfix"></div>
<div class="ln_solid"></div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary" name="submitOrderTracking">'.$this->l('Importer').'</button>
<button type="submit" class="btn btn-primary" name="submitOrderTracking">'.$this->l('Importer avec tracking').'</button>
<button type="submit" class="btn btn-primary" name="submitOrderTrackingNull">'.$this->l('Importer sans tracking').'</button>
</div>
</form>
</div>
</div>
</div>
</div>';
</div>
';
$this->_html .= $helperForm->renderScript();

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');
@ -173,9 +182,15 @@ if (Tools::isSubmit('submitMessage')) {
if ($contact->customer_service)
{
$ctStatusLast = false;
if ((int)$id_customer_thread)
{
$ct = new CustomerThread($id_customer_thread);
$ctStatusLast = $ct->status;
$ctStatusDate = $ct->date_upd;
$ct->status = 'open';
$ct->id_lang = (int)$cookie->id_lang;
$ct->id_contact = (int)($id_contact);
@ -213,6 +228,12 @@ if (Tools::isSubmit('submitMessage')) {
if ($ct->id)
{
// Update date_upd to the last interesting date
if ($ctStatusLast !== false && $ctStatusLast == 'open') {
$sql = 'UPDATE `'._DB_PREFIX_.'customer_thread` SET `date_upd` = "'.$ctStatusDate.'" WHERE id_customer_thread='. $ct->id;
Db::getInstance()->Execute($sql);
}
// adding (antadis) - linking reason and customer_thread
if (Tools::getValue('id_reason')) {
$id_reason = (int) Tools::getValue('id_reason');

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);

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