// merge 1.4 => 6117

This commit is contained in:
fBrignoli
2011-04-29 09:09:38 +00:00
parent eb254814c0
commit b8f460ed46
29 changed files with 199 additions and 217 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ class AdminAttributes extends AdminTab
<div id="colorAttributeProperties" style="'.((Validate::isLoadedObject($obj) AND $obj->isColorAttribute()) ? 'display: block;' : 'display: none;').'">
<label>'.$this->l('Color').'</label>
<div class="margin-form">
<input type="color" data-hex="true" class="color mColorPickerInput" name="color" value="'.(Tools::getValue('color', $color) ? htmlentities(Tools::getValue('color', $color)) : '#000000').'" /> <sup>*</sup>
<input width="20px" type="color" data-hex="true" class="color mColorPickerInput" name="color" value="'.(Tools::getValue('color', $color) ? htmlentities(Tools::getValue('color', $color)) : '#000000').'" /> <sup>*</sup>
<p class="clear">'.$this->l('HTML colors only (e.g.,').' "lightblue", "#CC6600")</p>
</div>
<label>'.$this->l('Texture:').' </label>
+53 -34
View File
@@ -692,7 +692,7 @@ class AdminOrders extends AdminTab
// '.$addressDelivery->country.($addressDelivery->id_state ? ' - '.$deliveryState->name : '').'<br />
// '.(!empty($addressDelivery->phone) ? $addressDelivery->phone.'<br />' : '').'
// '.(!empty($addressDelivery->phone_mobile) ? $addressDelivery->phone_mobile.'<br />' : '').'
// '.(!empty($addressDelivery->other) ? '<hr />'.$addressDelivery->other.'<br />' : '').'
.(!empty($addressDelivery->other) ? '<hr />'.$addressDelivery->other.'<br />' : '')
.'</fieldset>
</div>
<div style="float: left; margin-left: 40px">
@@ -700,6 +700,8 @@ class AdminOrders extends AdminTab
<legend><img src="../img/admin/invoice.gif" alt="'.$this->l('Invoice address').'" />'.$this->l('Invoice address').'</legend>
<div style="float: right"><a href="?tab=AdminAddresses&id_address='.$addressInvoice->id.'&addaddress&realedit=1&id_order='.$order->id.($addressDelivery->id == $addressInvoice->id ? '&address_type=2' : '').'&back='.urlencode($_SERVER['REQUEST_URI']).'&token='.Tools::getAdminToken('AdminAddresses'.(int)(Tab::getIdFromClassName('AdminAddresses')).(int)($cookie->id_employee)).'"><img src="../img/admin/edit.gif" /></a></div>
'.$this->displayAddressDetail($addressInvoice)
.(!empty($addressInvoice->other) ? '<hr />'.$addressInvoice->other.'<br />' : '')
.'</fieldset>
</div>
<div class="clear">&nbsp;</div>';
@@ -930,7 +932,7 @@ class AdminOrders extends AdminTab
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
}
public function displayAddressDetail($address)
public function displayAddressDetail($addressDelivery)
{
$optional_fields = array(
'company' => 1
@@ -938,49 +940,66 @@ class AdminOrders extends AdminTab
, 'phone_mobile' => 1
, 'address2' => 1
);
$out_field_sep = ' ';
$out_line_sep = '<br />';
$out = '';
$address_datas = AddressFormat::getAddressCountryFormat($address->id_country);
$lines_out = array();
$field_other = $address->other;
$lines_out = $address->getOrderedValues(array(
'spacer' => ' '
, 'optional' => $optional_fields
)
, $address_datas);
$address_datas = explode("\n", AddressFormat::getAddressCountryFormat($addressDelivery->id_country));
$out = implode("<br />", $lines_out) .((!(is_null($field_other) || $field_other == '') )? '<hr />'.$field_other: '');
foreach ($address_datas as $fields_line)
{
$fields_arr = array();
$is_empty = true;
foreach(explode(' ',$fields_line) as $field_item)
{
$field_item = trim($field_item);
if (!empty($addressDelivery->$field_item))
{
$fields_arr[] = $this->_getAddressFieldValue($addressDelivery, $field_item);
$is_empty = false;
}
else
{
if (!isset($optional_fields[$field_item]))
{
$fields_arr[] = $this->_getAddressFieldValue($addressDelivery, $field_item);
$is_empty = false;
}
}
}
if (!$is_empty)
{
$tmp_line = implode($out_field_sep, $fields_arr);
$line_out[] = $tmp_line;
}
}
$out = implode($out_line_sep, $line_out);
return $out;
}
/**
* returns String array values according to the given string pattern
*
*/
public function getOrderedValues($address, $pattern, array $given_values = null)
private function _getAddressFieldValue(Address $address, $field_name)
{
$out = array();
if (!empty($fields) && $fields != '' && !is_null($address))
{
$sep = "\n";
$line_sep = ' ';
$lines = explode($sep, $pattern);
foreach ($lines as $one_line)
$out = '';
if(!empty($field_name) && $field_name!= '' && !is_null($address))
switch($field_name)
{
if(!empty($one_line) && $one_line!= '')
{
$tmp_values = array();
$words = explode($line_sep, trim($one_line));
$tmp_words = array();
// Note: add other cases as needed
case 'state':
$deliveryState = new State((int)($address->id_state));
$out = (isset($deliveryState->name)) ? ' - '.$deliveryState->name : '';
break;
case 'state_iso':
$deliveryState = new State((int)($address->id_state));
$out = (isset($deliveryState->iso_code)) ? ' - '.$deliveryState->iso_code : '';
break;
// String append instead of Array append
foreach ($words as $one_word)
$tmp_values[$one_word] = (is_null($given_values)) ? $address->{$one_word} : $given_values[$one_word];
default:
$out = $address->$field_name;
$out[] = array($tmp_values, implode(' ', $tmp_values));
}
}
}
return $out;
}
+1 -1
View File
@@ -139,7 +139,7 @@ class AdminOrdersStates extends AdminTab
</div>
<label>'.$this->l('Color:').' </label>
<div class="margin-form">
<input type="color" data-hex="true" class="color mColorPickerInput" name="color" value="'.htmlentities($this->getFieldValue($obj, 'color'), ENT_COMPAT, 'UTF-8').'" />
<input width="20px" type="color" data-hex="true" class="color mColorPickerInput" name="color" value="'.htmlentities($this->getFieldValue($obj, 'color'), ENT_COMPAT, 'UTF-8').'" />
<p>'.$this->l('Status will be highlighted in this color. HTML colors only (e.g.,').' "lightblue", "#CC6600")</p>
</div>
<div class="margin-form">
+5
View File
@@ -748,9 +748,14 @@ class AdminTranslations extends AdminTab
if ($lang_packs!== false && $lang_packs != '' && $lang_packs = Tools::jsonDecode($lang_packs))
{
echo '<select id="params_import_language" name="params_import_language">';
echo '<optgroup label="'.$this->l('Add a language').'">';
$alreadyInstalled = '<optgroup label="'.$this->l('Update a language').'">';
foreach($lang_packs AS $lang_pack)
if (!Language::isInstalled($lang_pack->iso_code))
echo '<option value="'.$lang_pack->iso_code.'|'.$lang_pack->version.'">'.$lang_pack->name.'</option>';
else
$alreadyInstalled.='<option value="'.$lang_pack->iso_code.'|'.$lang_pack->version.'">'.$lang_pack->name.'</option>';
echo '</optgroup>'.$alreadyInstalled.'</optgroup>';
echo '</select>';
}
echo ' </div>
-91
View File
@@ -216,97 +216,6 @@ class AddressCore extends ObjectModel
return $out;
}
/**
* Returns values ordered in an array according to given fields
* @param array $config set options for the method formated as
$config = array(
'spacer' => ' '
, 'optional' => array(
'company' => 1
,'phone' => 1
)
, 'ignore' => array(
'phone_mobile' => 1
)
, 'return_set' => true (true: hash return, false: String array)
)
* @param String $pattern lines of each needed fields \n splitted
* @param array $values optionnal given values
* @return array field values or hash values
*/
public static function getOrderedValuesFromArray($config, $pattern, array $values = null)
{
$tmp_address = new Address();
$out = $tmp_address->getOrderedValues($config, $pattern, $values);
unset($tmp_address);
return $out;
}
/**
* Returns values ordered in an array according to given fields
* @param array $config set options for the method formated as
$config = array(
'spacer' => ' '
, 'optional' => array(
'company' => 1
,'phone' => 1
,'phone_mobile' => 1
)
, 'return_set' => true
)
* @param String $address_datas lines of each needed fields \n splitted
* @param array $given_values optionnal given values
* @return array field values or values in a hash
*/
public function getOrderedValues(array $config, $address_datas, array $given_values = null)
{
$spacer = $config["spacer"]; // String used for joining lines_out
$optional_fields = (isset($config["optional"]))? $config["optional"] : array(); // array hash tells which fields are optional
$ignore = (isset($config["ignore"]))? $config["ignore"] : array(); // array hash tells which fields are ignored
$return_set = (!empty($config["return_set"])) ? $config["return_set"] : false;
$line_breaker = "\n"; // used in address_datas format
$lines_out = array();
$fields_lines = explode($line_breaker, $address_datas);
foreach ($fields_lines as $one_line)
if(!empty($one_line) && $one_line!= '')
{
$tmp_values = array();
$val_added = false;
$words = explode(' ', trim($one_line));
$tmp_words = array();
foreach ($words as $one_word)
{
if (!isset($ignore[$one_word]))
{
$one_word = trim($one_word);
$val = (is_null($given_values)) ? $this->{$one_word} : $given_values[$one_word];
if ((!empty($val) && $val != '') || ((empty($val) || $val == '') && (isset($optional_fields[$one_word]) != 1)))
{
$tmp_values[$one_word] = $val;
$val_added = true;
}
}
}
if ($val_added)
$lines_out[] = ($return_set) ? $tmp_values : implode($spacer, $tmp_values);
}
return $lines_out;
}
public function getFields()
{
parent::validateFields();
+25 -6
View File
@@ -60,6 +60,8 @@ class AddressFormatCore extends ObjectModel
$out = true;
$addr_f_validate = Address::getFieldsValidate();
$addr_f_validate['state_iso'] = 1; // adding state iso code into allowed fields
$fields_format = explode("\n", $this->format);
foreach($fields_format as $field_line)
{
@@ -73,20 +75,30 @@ class AddressFormatCore extends ObjectModel
}
return $out;
}
/**
* Returns address format fields in array by country
*
* @param Integer PS_COUNTRY.id
* @param Integer PS_COUNTRY.id if null using default country
* @return Array String field address format
*/
public static function getOrderedAddressFields($id_country)
public static function getOrderedAddressFields($id_country = 0, $split_all = false)
{
$out = array();
$field_set = explode("\n", self::getAddressCountryFormat($id_country));
foreach ($field_set as $field_item)
{
$out[] = trim($field_item);
// $field_item = trim($field_item);
if ($split_all)
{
foreach(explode(' ',$field_item) as $word_item)
$out[] = trim($word_item);
}
else
$out[] = trim($field_item);
}
return $out;
}
@@ -97,9 +109,16 @@ class AddressFormatCore extends ObjectModel
* @param Integer PS_COUNTRY.id
* @return String field address format
*/
public static function getAddressCountryFormat($id_country)
public static function getAddressCountryFormat($id_country = 0)
{
$out = '';
$out = '';
$id_country = (int) $id_country;
if ($id_country <= 0)
{
$selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT'));
}
$tmp_obj = new AddressFormat();
$tmp_obj->id_country = $id_country;
$out = $tmp_obj->getFormat($tmp_obj->id_country);
@@ -131,7 +150,7 @@ class AddressFormatCore extends ObjectModel
FROM `'._DB_PREFIX_.$this->table.'`
WHERE `id_country` = '.(int)($id_country));
return isset($result['format']) ? $result['format'] : false;
return isset($result['format']) ? trim($result['format']) : '';
}
}
+2 -2
View File
@@ -319,7 +319,7 @@ abstract class AdminTabCore
public function includeSubTab($methodname, $actions = array())
{
if (!isset($this->_includeTab) OR !is_array($this->_includeTab))
return ;
return false;
$key = 0;
$inc = false;
foreach ($this->_includeTab as $subtab => $extraVars)
@@ -1553,7 +1553,7 @@ abstract class AdminTabCore
global $currentIndex, $cookie, $tab;
if (!isset($this->_fieldsOptions) OR !sizeof($this->_fieldsOptions))
return ;
return false;
$defaultLanguage = (int)Configuration::get('PS_LANG_DEFAULT');
$this->_languages = Language::getLanguages(false);
+1 -1
View File
@@ -305,7 +305,7 @@ class CustomerCore extends ObjectModel
public function getAddresses($id_lang)
{
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT a.*, cl.`name` AS country, s.name AS state
SELECT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
FROM `'._DB_PREFIX_.'address` a
LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`)
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`)
+1
View File
@@ -146,6 +146,7 @@ class FeatureValueCore extends ObjectModel
LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.`id_feature_value` = fv.`id_feature_value`)
WHERE `value` = \''.pSQL($name).'\'
AND fv.`id_feature` = '.(int)$id_feature.'
AND fv.`custom` = 0
GROUP BY fv.`id_feature_value` LIMIT 1');
if (!isset($rq[0]['id_feature_value']) OR !$id_feature_value = (int)$rq[0]['id_feature_value'])
+3 -3
View File
@@ -79,7 +79,7 @@ class FrontControllerCore
return;
self::$initialized = true;
if ($this->ssl AND !(empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) != 'off') AND Configuration::get('PS_SSL_ENABLED'))
if ($this->ssl AND (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off') AND Configuration::get('PS_SSL_ENABLED'))
{
header('HTTP/1.1 301 Moved Permanently');
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
@@ -194,8 +194,8 @@ class FrontControllerCore
$navigationPipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>');
$smarty->assign('navigationPipe', $navigationPipe);
$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? 'https://' : 'http://';
$protocol_content = ((isset($useSSL) AND $useSSL AND Configuration::get('PS_SSL_ENABLED')) OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? 'https://' : 'http://';
$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
$protocol_content = ((isset($useSSL) AND $useSSL AND Configuration::get('PS_SSL_ENABLED')) OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
if (!defined('_PS_BASE_URL_'))
define('_PS_BASE_URL_', Tools::getShopDomain(true));
if (!defined('_PS_BASE_URL_SSL_'))
+4 -3
View File
@@ -439,7 +439,8 @@ class PDFCore extends PDF_PageGroupCore
);
$ignore_fields = array(
'phone' => 1
, 'mobile_phone' =>1
, 'mobile_phone' => 1
, 'state_iso' => 1
);
$width = 100;
@@ -469,12 +470,12 @@ class PDFCore extends PDF_PageGroupCore
$tmp_dlv = $delivery_address->{$field_name};
if (!((empty($tmp_inv) || $tmp_inv == '') && isset($optional_fields[$field_name])))
{
$tmp_inv = ($field_name == "country") ? $tmp_inv.($deliveryState ? ' - '.$deliveryState->name : ''): $tmp_inv;
$tmp_inv = ($field_name == "country") ? $tmp_inv.($deliveryState ? ' - '.$deliveryState->iso_code : ''): $tmp_inv;
$tmp_inv_vals[] = Tools::iconv('utf-8', self::encoding(), $tmp_inv);
}
if (!((empty($tmp_dlv) || $tmp_dlv == '') && isset($optional_fields[$field_name])))
{
$tmp_dlv = ($field_name == "country") ? $tmp_dlv.($deliveryState ? ' - '.$deliveryState->name : ''): $tmp_dlv;
$tmp_dlv = ($field_name == "country") ? $tmp_dlv.($deliveryState ? ' - '.$deliveryState->iso_code : ''): $tmp_dlv;
$tmp_dlv_vals[] = Tools::iconv('utf-8', self::encoding(), $tmp_dlv);
}
}
-1
View File
@@ -88,7 +88,6 @@ abstract class PaymentModuleCore extends Module
* @param string $paymentMethod Payment method (eg. 'Credit card')
* @param string $message Message to attach to order
*/
public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false)
{
global $cart;
+18 -19
View File
@@ -1594,35 +1594,34 @@ class ProductCore extends ObjectModel
$quantity = ($id_cart AND $cart_quantity) ? $cart_quantity : $quantity;
$id_currency = (int)(Validate::isLoadedObject($cur_cart) ? $cur_cart->id_currency : ((isset($cookie->id_currency) AND (int)($cookie->id_currency)) ? $cookie->id_currency : Configuration::get('PS_CURRENCY_DEFAULT')));
// retrieve address informations
$id_country = (int)Country::getDefaultCountryId();
$id_country = (int)Country::getDefaultCountryId();
$id_state = 0;
$id_county = 0;
if (!$id_address)
$id_address = $cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')};
if ($id_address)
{
if ($id_address = $cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')})
$address_infos = Address::getCountryAndState($id_address);
if ($address_infos['id_country'])
{
$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']);
$postcode = (int)$address_infos['postcode'];
$id_county = (int)County::getIdCountyByZipCode($id_state, $postcode);
}
} else if (isset($cookie->id_country)) {
// fetch address from cookie
$id_country = (int)$cookie->id_country;
$id_state = (int)$cookie->id_state;
$postcode = (int)$cookie->postcode;
$id_country = (int)($address_infos['id_country']);
$id_state = (int)($address_infos['id_state']);
$postcode = (int)$address_infos['postcode'];
$id_county = (int)County::getIdCountyByZipCode($id_state, $postcode);
}
}
elseif (isset($cookie->id_country))
{
// fetch address from cookie
$id_country = (int)$cookie->id_country;
$id_state = (int)$cookie->id_state;
$postcode = (int)$cookie->postcode;
$id_county = (int)County::getIdCountyByZipCode($id_state, $postcode);
}
if (Tax::excludeTaxeOption())
+1 -1
View File
@@ -219,7 +219,7 @@ class WebserviceRequestCore
$display_errors = strtolower(ini_get('display_errors')) != 'off';
// Error handler
set_error_handler(array('WebserviceRequest', 'webserviceErrorHandler'));
set_error_handler(array($this, 'webserviceErrorHandler'));
ini_set('html_errors', 'off');
$this->_wsUrl = Tools::getHttpHost(true).__PS_BASE_URI__.'api/';
+2 -6
View File
@@ -9,7 +9,6 @@
<module name="blockcategories"/>
<module name="blockcms"/>
<module name="blockcurrencies"/>
<module name="blockinfos"/>
<module name="blocklanguages"/>
<module name="blocklayered"/>
<module name="blocklink"/>
@@ -26,11 +25,10 @@
<module name="blocksupplier"/>
<module name="blocktags"/>
<module name="blockuserinfo"/>
<module name="blockvariouslinks"/>
<module name="blockviewed"/>
<module name="blockwishlist"/>
<module name="canonicalurl"/>
<module name="cashondelivery"/>
<module name="carriercompare"/>
<module name="cheque"/>
<module name="crossselling"/>
<module name="dateofdelivery"/>
@@ -74,7 +72,6 @@
<module name="statsequipment"/>
<module name="statsforecast"/>
<module name="statsgeolocation"/>
<module name="statshome"/>
<module name="statslive"/>
<module name="statsnewsletter"/>
<module name="statsorigin"/>
@@ -110,7 +107,6 @@
<module name="ogone"/>
<module name="paysafecard"/>
<module name="paypal"/>
<module name="paypalapi"/>
<module name="reverso"/>
<module name="secuvad"/>
<module name="socolissimo"/>
@@ -119,4 +115,4 @@
<module name="twenga"/>
<module name="uspscarrier"/>
</modules>
</modules_list>
</modules_list>
+11
View File
@@ -256,6 +256,15 @@ class AddressControllerCore extends FrontController
'select_address' => (int)(Tools::getValue('select_address'))
));
}
protected function _processAddressFormat()
{
$id_country = is_null($this->_address)? 0 : (int)$this->_address->id_country;
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($id_country, $split_all = true);
self::$smarty->assign('ordered_adr_fields', $dlv_adr_fields);
}
public function displayHeader()
{
@@ -266,6 +275,8 @@ class AddressControllerCore extends FrontController
public function displayContent()
{
parent::displayContent();
$this->_processAddressFormat();
self::$smarty->display(_PS_THEME_DIR_.'address.tpl');
}
+9 -8
View File
@@ -120,7 +120,7 @@ class OrderOpcControllerCore extends ParentOrderController
$blockUserInfo = new BlockUserInfo();
}
self::$smarty->assign('isVirtualCart', self::$cart->isVirtualCart());
$this->processAddressFormat();
$this->_processAddressFormat();
$this->_assignAddress();
// Wrapping fees
$wrapping_fees = (float)(Configuration::get('PS_GIFT_WRAPPING_PRICE'));
@@ -267,7 +267,7 @@ class OrderOpcControllerCore extends ParentOrderController
{
parent::displayContent();
$this->processAddressFormat();
$this->_processAddressFormat();
self::$smarty->display(_PS_THEME_DIR_.'errors.tpl');
self::$smarty->display(_PS_THEME_DIR_.'order-opc.tpl');
@@ -450,11 +450,15 @@ class OrderOpcControllerCore extends ParentOrderController
return 0;
}
protected function processAddressFormat()
protected function _processAddressFormat()
{
$selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT'));
$inv_adr_fields = AddressFormat::getOrderedAddressFields($selectedCountry);
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($selectedCountry);
$address_delivery = new Address((int)self::$cart->id_address_delivery);
$address_invoice = new Address((int)self::$cart->id_address_invoice);
$inv_adr_fields = AddressFormat::getOrderedAddressFields((int)$address_delivery->id_country);
$dlv_adr_fields = AddressFormat::getOrderedAddressFields((int)$address_invoice->id_country);
$inv_all_fields = array();
$dlv_all_fields = array();
@@ -465,9 +469,6 @@ class OrderOpcControllerCore extends ParentOrderController
foreach(explode(' ',$fields_line) as $field_item)
${$adr_type.'_all_fields'}[] = trim($field_item);
// DEBUG echo('<br />processAddressFormat: inv_all_fields: ' . var_export($inv_all_fields, true)
// DEBUG .'<br />processAddressFormat: inv_all_fields: ' . var_export($dlv_all_fields, true));
self::$smarty->assign($adr_type.'_adr_fields', ${$adr_type.'_adr_fields'});
self::$smarty->assign($adr_type.'_all_fields', ${$adr_type.'_all_fields'});
+1 -3
View File
@@ -363,9 +363,7 @@ INSERT INTO `PREFIX_feature_product` (`id_feature`, `id_product`, `id_feature_va
(1, 1, 11),(1, 2, 15),(2, 1, 12),(2, 2, 16),(3, 1, 14),(3, 2, 18),(4, 1, 13),(4, 2, 17),(5, 1, 10),(5, 2, 10),(3, 7, 26),(5, 7, 9),(4, 7, 25),(2, 7, 24),(1, 7, 23);
INSERT INTO `PREFIX_feature_value` (`id_feature_value`, `id_feature`, `custom`) VALUES
(11, 1, 1),(15, 1, 1),(12, 2, 1),(16, 2, 1),(14, 3, 1),(18, 3, 1),(13, 4, 1),(17, 4, 1),(26, 3, 1),(25, 4, 1),(24, 2, 1),(23, 1, 1);
INSERT INTO `PREFIX_feature_value` (`id_feature_value`, `id_feature`, `custom`) VALUES (9, 5, NULL), (10, 5, NULL);
(11, 1, 1),(15, 1, 1),(12, 2, 1),(16, 2, 1),(14, 3, 1),(18, 3, 1),(13, 4, 1),(17, 4, 1),(26, 3, 1),(25, 4, 1),(24, 2, 1),(23, 1, 1),(9, 5, 0),(10, 5, 0);
INSERT INTO `PREFIX_feature_value_lang` (`id_feature_value`, `id_lang`, `value`) VALUES
(13, 1, '49.2 g'),(13, 2, '49,2 g'),(13, 3, '49,2 g'),(13, 4, '49.2 g'),(13, 5, '49.2 g'),(12, 2, '52,3 mm'),(12, 1, '2.06 in'),(12, 3, '52.3 mm'),(12, 4, '52.3 mm'),(12, 5, '52.3 mm'),(11, 2, '69,8 mm'),(11, 1, '2.75 in'),(11, 3, '69.8 mm'),(11, 4, '69.8 mm'),(11, 5, '69.8 mm'),
+5 -6
View File
@@ -332,7 +332,7 @@ INSERT INTO `PREFIX_country_lang` (`id_country`, `id_lang`, `name`) VALUES
(14, 1, 'Poland'),(14, 2, 'Pologne'),(14, 3, 'Polonia'),(15, 1, 'Portugal'),(15, 2, 'Portugal'),(15, 3, 'Portugal'),
(16, 1, 'Czech Republic'),(16, 2, 'République Tchèque'),(16, 3, 'República Checa'),(17, 1, 'United Kingdom'),(17, 2, 'Royaume-Uni'),(17, 3, 'Reino Unido'),
(18, 1, 'Sweden'),(18, 2, 'Suède'),(18, 3, 'Suecia'),(19, 1, 'Switzerland'),(19, 2, 'Suisse'),(19, 3, 'Suiza'),(20, 1, 'Denmark'),
(20, 2, 'Danemark'),(20, 3, 'Dinamarca'),(21, 1, 'USA'),(21, 2, 'États-Unis'),(21, 3, 'EE.UU.'),(22, 1, 'HongKong'),(22, 2, 'Hong-Kong'),
(20, 2, 'Danemark'),(20, 3, 'Dinamarca'),(21, 1, 'United States'),(21, 2, 'États-Unis'),(21, 3, 'EE.UU.'),(22, 1, 'HongKong'),(22, 2, 'Hong-Kong'),
(22, 3, 'Hong Kong'),(23, 1, 'Norway'),(23, 2, 'Norvège'),(23, 3, 'Noruega'),(24, 1, 'Australia'),(24, 2, 'Australie'),(24, 3, 'Australia'),
(25, 1, 'Singapore'),(25, 2, 'Singapour'),(25, 3, 'Singapur'),(26, 1, 'Ireland'),(26, 2, 'Eire'),(26, 3, 'Irlanda'),(27, 1, 'New Zealand'),
(27, 2, 'Nouvelle-Zélande'),(27, 3, 'Nueva Zelanda'),(28, 1, 'South Korea'),(28, 2, 'Corée du Sud'),(28, 3, 'Corea del Sur'),(29, 1, 'Israel'),
@@ -1029,10 +1029,9 @@ INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `n
INSERT INTO `PREFIX_address_format` (`id_country`, `format`)
(SELECT `id_country` as id_country, 'firstname lastname\ncompany\nvat_number\naddress1\naddress2\npostcode city\ncountry\nphone' as format FROM `PREFIX_country`);
UPDATE `PREFIX_address_format` set `format`='firstname lastname
company
address1
address2
city state postcode
UPDATE `PREFIX_address_format` set `format`='company
firstname lastname
address1 address2
city state_iso postcode
country
phone' where `id_country`=21;
+1 -8
View File
@@ -2,13 +2,6 @@ SET NAMES 'utf8';
INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`, `live_edit`) VALUES ('afterSaveAdminMeta', 'After save configuration in AdminMeta', 'After save configuration in AdminMeta', 0, 0);
INSERT INTO `PREFIX_hook_module` (`id_module`, `id_hook`, `position`) VALUES
(
(SELECT `id_module` FROM `PREFIX_module` WHERE `name` = 'blockcategories'),
(SELECT `id_hook` FROM `PREFIX_hook` WHERE `name` = 'afterSaveAdminMeta'), 1
);
ALTER TABLE `PREFIX_webservice_account` ADD `is_module` TINYINT( 2 ) NOT NULL DEFAULT '0' AFTER `class_name` ,
ADD `module_name` VARCHAR( 50 ) NULL DEFAULT NULL AFTER `is_module`;
@@ -47,4 +40,4 @@ country
phone' where `id_country`=21;
/* PHP:alter_cms_block(); */;
/* PHP:add_module_to_hook(blockcategories, afterSaveAdminMeta); */;
+4 -4
View File
@@ -251,8 +251,8 @@ if (!$params['category']->active)
break;
case 'id_attribute_group':
$queryFilters .= ' AND p.id_product IN ( SELECT pa.`id_product`
FROM `ps_product_attribute_combination` pac
LEFT JOIN `ps_product_attribute` pa
FROM `'._DB_PREFIX_.'product_attribute_combination` pac
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
ON (pa.`id_product_attribute` = pac.`id_product_attribute`) WHERE ';
foreach ($filterValues AS $filterValue)
@@ -260,10 +260,10 @@ if (!$params['category']->active)
$queryFilters = rtrim($queryFilters, 'OR ').')';
break;
case 'category':
$parent = new category($id_parent);
$parent = new Category($id_parent);
if (!sizeof($selectedFilters['category']))
$queryFilters .= ' AND p.id_product IN ( SELECT id_product FROM '._DB_PREFIX_.'category_product cp
LEFT JOIN ps_category c ON (c.id_category = cp.id_category)
LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category)
WHERE 1 AND c.nleft >= parent->nleft AND c.nright <= parent->nright';
else
{
+1 -1
View File
@@ -81,7 +81,7 @@ class BlockSearch extends Module
{
global $smarty;
$smarty->assign('ENT_QUOTES', ENT_QUOTES);
$smarty->assign('search_ssl', (int)(isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'));
$smarty->assign('search_ssl', (int)(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'));
$ajaxSearch=(int)(Configuration::get('PS_SEARCH_AJAX'));
$smarty->assign('ajaxsearch', $ajaxSearch);
+3 -1
View File
@@ -28,6 +28,7 @@
require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php');
require_once(dirname(__FILE__).'/WishList.php');
require_once(dirname(__FILE__).'/blockwishlist.php');
$errors = array();
@@ -53,7 +54,8 @@ if ($cookie->isLogged())
if(!isset($cookie->id_wishlist) OR $cookie->id_wishlist == '')
{
$wishlist = new WishList();
$wishlist->name = 'My WishList';
$modWishlist = new BlockWishList();
$wishlist->name = $modWishlist->l('My wishlist');
$wishlist->id_customer = (int)($cookie->id_customer);
list($us, $s) = explode(' ', microtime());
srand($s * $us);
+1
View File
@@ -10,6 +10,7 @@ $_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_09dc02ecbb078868a3a86dde
$_MODULE['<{blockwishlist}prestashop>blockwishlist-extra_15b94c64c4d5a4f7172e5347a36b94fd'] = 'Ajouter à ma liste';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_2715a65604e1af3d6933b61704865daf'] = 'Bloc liste de cadeaux';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_7244141a5de030c4c882556f4fd70a8b'] = 'Ajoute un bloc gérant les listes de cadeaux';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_4840f4437f55e68a587d358090b948d1'] = 'Ma liste de cadeaux';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_5ef2d617096ae7b47a83f3d4de9c84bd'] = 'Choix invalide pour l\'activation du module';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres enregistrés';
+1 -1
View File
@@ -80,7 +80,7 @@ class Treepodia extends Module
private function _getShopURL()
{
return ((Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? Tools::getShopDomainSsl() : Tools::getShopDomain()).__PS_BASE_URI__;
return ((Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? Tools::getShopDomainSsl() : Tools::getShopDomain()).__PS_BASE_URI__;
}
public function generateXmlFlow()
+17 -6
View File
@@ -90,6 +90,11 @@ $(function(){ldelim}
<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>
<p class="required text dni">
<label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{else}{if isset($address->dni)}{$address->dni|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{if $vat_display == 2}
<div id="vat_area">
{elseif $vat_display == 1}
@@ -104,40 +109,43 @@ $(function(){ldelim}
</p>
</div>
</div>
{foreach from=$ordered_adr_fields item=field_name}
{if $field_name eq 'firstname'}
<p class="required text">
<label for="firstname">{l s='First name'}</label>
<input type="text" name="firstname" id="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{else}{if isset($address->firstname)}{$address->firstname|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<input type="text" name="firstname" id="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{elseif isset($address->firstname)}{$address->firstname|escape:'htmlall':'UTF-8'}{/if}" />
<sup>*</sup>
</p>
{elseif $field_name eq 'lastname'}
<p class="required text">
<label for="lastname">{l s='Last name'}</label>
<input type="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{else}{if isset($address->lastname)}{$address->lastname|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<sup>*</sup>
</p>
<p class="required text dni">
<label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{else}{if isset($address->dni)}{$address->dni|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{elseif $field_name eq 'address1'}
<p class="required text">
<label for="address1">{l s='Address'}</label>
<input type="text" id="address1" name="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{else}{if isset($address->address1)}{$address->address1|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<sup>*</sup>
</p>
{elseif $field_name eq 'address2'}
<p class="required text">
<label for="address2">{l s='Address (Line 2)'}</label>
<input type="text" id="address2" name="address2" value="{if isset($smarty.post.address2)}{$smarty.post.address2}{else}{if isset($address->address2)}{$address->address2|escape:'htmlall':'UTF-8'}{/if}{/if}" />
</p>
{elseif $field_name eq 'postcode'}
<p class="required postcode text">
<label for="postcode">{l s='Zip / Postal Code'}</label>
<input type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'htmlall':'UTF-8'}{/if}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
<sup>*</sup>
</p>
{elseif $field_name eq 'city'}
<p class="required text">
<label for="city">{l s='City'}</label>
<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>
{elseif $field_name eq 'country'}
<p class="required select">
<label for="id_country">{l s='Country'}</label>
<select id="id_country" name="id_country">{$countries_list}</select>
@@ -175,6 +183,9 @@ $(function(){ldelim}
</select>
<sup>*</sup>
</p>
{/if}
{/foreach}
<p class="textarea">
<label for="other">{l s='Additional information'}</label>
<textarea id="other" name="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{else}{if isset($address->other)}{$address->other|escape:'htmlall':'UTF-8'}{/if}{/if}</textarea>
+14 -3
View File
@@ -35,9 +35,20 @@ function updateAddressesDisplay(first_view)
// update content of delivery address
updateAddressDisplay('delivery');
var txtInvoiceTitle = "";
try{
var adrs_titles = getAddressesTitles();
txtInvoiceTitle = adrs_titles.invoice;
}
catch (e)
{
}
// update content of invoice address
//if addresses have to be equals...
var txtInvoiceTitle = $('ul#address_invoice li.address_title').html();
if ($('input[type=checkbox]#addressesAreEquals:checked').length == 1)
{
$('#address_invoice_form:visible').hide('fast');
@@ -55,13 +66,13 @@ function updateAddressesDisplay(first_view)
$('ul#address_invoice li.address_title').html(txtInvoiceTitle);
}
}
if(!first_view)
{
if (orderProcess == 'order')
updateAddresses();
}
return true;
}
+11 -4
View File
@@ -44,6 +44,8 @@
,city: '{$address.city|addslashes}'
,country: '{$address.country|addslashes}'
,state: '{$address.state|default:''|addslashes}'
,state_iso: '{$address.state_iso|default:''|addslashes}'
{rdelim};
{/foreach}
@@ -66,14 +68,19 @@
]
{rdelim};
function getAddressesTitles()
{ldelim}
return {ldelim}
'invoice': "{l s='Your billing address'}"
, 'delivery': "{l s='Your delivery address'}"
{rdelim};
{rdelim}
function buildAddressBlock(id_address, address_type, dest_comp)
{ldelim}
var adr_titles_vals = {ldelim}
'invoice': "{l s='Your billing address'}"
, 'delivery': "{l s='Your delivery address'}"
{rdelim};
var adr_titles_vals = getAddressesTitles();
var li_content = addresses_values[id_address];
var fields_name = ["title"];
+3 -3
View File
@@ -36,10 +36,10 @@
<br />
<span id="store_hours">{l s='Hours:'}</span>
<table style="font-size: 9px;">
{foreach $days_datas as $one_day}
{foreach from=$days_datas item=one_day}
<tr>
<td style="width: 70px;">{$one_day['day']}</td>
<td>{$one_day['hours']}</td>
<td style="width: 70px;">{$one_day.day}</td>
<td>{$one_day.hours}</td>
</tr>
{/foreach}
</table>